home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1988-08-01 | 44.9 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: TESample.c
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Mon Aug 1 18:08:04 1988, modified Mon Aug 1 18:08:04 1988, creator 'MPS ', type ASCII, 44463 bytes "TESample.c" , at 0xae2f 1168 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 54 45 53 61 6d 70 | 6c 65 2e 63 00 00 00 00 |..TESamp|le.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 ad af 00 | 00 04 90 9f 1a 9c 44 9f |........|......D.|
|00000060| 1a 9c 44 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..D.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 cd fa 00 00 |........|........|
|00000080| 2f 2a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/*------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000d0| 0d 23 0d 23 09 41 70 70 | 6c 65 20 4d 61 63 69 6e |.#.#.App|le Macin|
|000000e0| 74 6f 73 68 20 44 65 76 | 65 6c 6f 70 65 72 20 54 |tosh Dev|eloper T|
|000000f0| 65 63 68 6e 69 63 61 6c | 20 53 75 70 70 6f 72 74 |echnical| Support|
|00000100| 0d 23 0d 23 09 4d 75 6c | 74 69 46 69 6e 64 65 72 |.#.#.Mul|tiFinder|
|00000110| 2d 41 77 61 72 65 20 53 | 69 6d 70 6c 65 20 54 65 |-Aware S|imple Te|
|00000120| 78 74 45 64 69 74 20 53 | 61 6d 70 6c 65 20 41 70 |xtEdit S|ample Ap|
|00000130| 70 6c 69 63 61 74 69 6f | 6e 0d 23 0d 23 09 54 45 |plicatio|n.#.#.TE|
|00000140| 53 61 6d 70 6c 65 0d 23 | 0d 23 09 54 68 69 73 20 |Sample.#|.#.This |
|00000150| 66 69 6c 65 3a 20 54 45 | 53 61 6d 70 6c 65 2e 63 |file: TE|Sample.c|
|00000160| 09 2d 09 43 20 53 6f 75 | 72 63 65 0d 23 0d 23 09 |.-.C Sou|rce.#.#.|
|00000170| 43 6f 70 79 72 69 67 68 | 74 20 a9 20 31 39 38 38 |Copyrigh|t . 1988|
|00000180| 20 41 70 70 6c 65 20 43 | 6f 6d 70 75 74 65 72 2c | Apple C|omputer,|
|00000190| 20 49 6e 63 2e 0d 23 09 | 41 6c 6c 20 72 69 67 68 | Inc..#.|All righ|
|000001a0| 74 73 20 72 65 73 65 72 | 76 65 64 2e 0d 23 0d 23 |ts reser|ved..#.#|
|000001b0| 09 56 65 72 73 69 6f 6e | 73 3a 09 31 2e 30 09 09 |.Version|s:.1.0..|
|000001c0| 09 09 09 38 2f 38 38 0d | 23 0d 23 09 43 6f 6d 70 |...8/88.|#.#.Comp|
|000001d0| 6f 6e 65 6e 74 73 3a 09 | 54 45 53 61 6d 70 6c 65 |onents:.|TESample|
|000001e0| 2e 70 09 09 09 41 75 67 | 75 73 74 20 31 2c 20 31 |.p...Aug|ust 1, 1|
|000001f0| 39 38 38 0d 23 09 09 09 | 09 54 45 53 61 6d 70 6c |988.#...|.TESampl|
|00000200| 65 2e 63 09 09 09 41 75 | 67 75 73 74 20 31 2c 20 |e.c...Au|gust 1, |
|00000210| 31 39 38 38 0d 23 09 09 | 09 09 54 45 53 61 6d 70 |1988.#..|..TESamp|
|00000220| 6c 65 2e 61 09 09 09 41 | 75 67 75 73 74 20 31 2c |le.a...A|ugust 1,|
|00000230| 20 31 39 38 38 0d 23 09 | 09 09 09 54 45 53 61 6d | 1988.#.|...TESam|
|00000240| 70 6c 65 2e 72 09 09 09 | 41 75 67 75 73 74 20 31 |ple.r...|August 1|
|00000250| 2c 20 31 39 38 38 0d 23 | 09 09 09 09 54 45 53 61 |, 1988.#|....TESa|
|00000260| 6d 70 6c 65 2e 68 09 09 | 09 41 75 67 75 73 74 20 |mple.h..|.August |
|00000270| 31 2c 20 31 39 38 38 0d | 23 09 09 09 09 50 54 45 |1, 1988.|#....PTE|
|00000280| 53 61 6d 70 6c 65 2e 6d | 61 6b 65 09 09 41 75 67 |Sample.m|ake..Aug|
|00000290| 75 73 74 20 31 2c 20 31 | 39 38 38 0d 23 09 09 09 |ust 1, 1|988.#...|
|000002a0| 09 43 54 45 53 61 6d 70 | 6c 65 2e 6d 61 6b 65 09 |.CTESamp|le.make.|
|000002b0| 09 41 75 67 75 73 74 20 | 31 2c 20 31 39 38 38 0d |.August |1, 1988.|
|000002c0| 23 0d 23 09 54 45 53 61 | 6d 70 6c 65 20 69 73 20 |#.#.TESa|mple is |
|000002d0| 61 6e 20 65 78 61 6d 70 | 6c 65 20 61 70 70 6c 69 |an examp|le appli|
|000002e0| 63 61 74 69 6f 6e 20 74 | 68 61 74 20 64 65 6d 6f |cation t|hat demo|
|000002f0| 6e 73 74 72 61 74 65 73 | 20 68 6f 77 20 0d 23 09 |nstrates| how .#.|
|00000300| 74 6f 20 69 6e 69 74 69 | 61 6c 69 7a 65 20 74 68 |to initi|alize th|
|00000310| 65 20 63 6f 6d 6d 6f 6e | 6c 79 20 75 73 65 64 20 |e common|ly used |
|00000320| 74 6f 6f 6c 62 6f 78 20 | 6d 61 6e 61 67 65 72 73 |toolbox |managers|
|00000330| 2c 20 6f 70 65 72 61 74 | 65 20 0d 23 09 73 75 63 |, operat|e .#.suc|
|00000340| 63 65 73 73 66 75 6c 6c | 79 20 75 6e 64 65 72 20 |cessfull|y under |
|00000350| 4d 75 6c 74 69 46 69 6e | 64 65 72 2c 20 68 61 6e |MultiFin|der, han|
|00000360| 64 6c 65 20 64 65 73 6b | 20 61 63 63 65 73 73 6f |dle desk| accesso|
|00000370| 72 69 65 73 20 61 6e 64 | 20 0d 23 09 63 72 65 61 |ries and| .#.crea|
|00000380| 74 65 2c 20 67 72 6f 77 | 2c 20 61 6e 64 20 7a 6f |te, grow|, and zo|
|00000390| 6f 6d 20 77 69 6e 64 6f | 77 73 2e 20 54 68 65 20 |om windo|ws. The |
|000003a0| 66 75 6e 64 61 6d 65 6e | 74 61 6c 20 54 65 78 74 |fundamen|tal Text|
|000003b0| 45 64 69 74 20 0d 23 09 | 74 6f 6f 6c 62 6f 78 20 |Edit .#.|toolbox |
|000003c0| 63 61 6c 6c 73 20 61 6e | 64 20 54 65 78 74 45 64 |calls an|d TextEd|
|000003d0| 69 74 20 61 75 74 6f 73 | 63 72 6f 6c 6c 20 61 72 |it autos|croll ar|
|000003e0| 65 20 64 65 6d 6f 6e 73 | 74 72 61 74 65 64 2e 20 |e demons|trated. |
|000003f0| 49 74 20 0d 23 09 61 6c | 73 6f 20 73 68 6f 77 73 |It .#.al|so shows|
|00000400| 20 68 6f 77 20 74 6f 20 | 63 72 65 61 74 65 20 61 | how to |create a|
|00000410| 6e 64 20 6d 61 69 6e 74 | 61 69 6e 20 73 63 72 6f |nd maint|ain scro|
|00000420| 6c 6c 62 61 72 20 63 6f | 6e 74 72 6f 6c 73 2e 0d |llbar co|ntrols..|
|00000430| 23 0d 23 09 49 74 20 64 | 6f 65 73 20 6e 6f 74 20 |#.#.It d|oes not |
|00000440| 62 79 20 61 6e 79 20 6d | 65 61 6e 73 20 64 65 6d |by any m|eans dem|
|00000450| 6f 6e 73 74 72 61 74 65 | 20 61 6c 6c 20 74 68 65 |onstrate| all the|
|00000460| 20 74 65 63 68 6e 69 71 | 75 65 73 20 79 6f 75 20 | techniq|ues you |
|00000470| 0d 23 09 6e 65 65 64 20 | 66 6f 72 20 61 20 6c 61 |.#.need |for a la|
|00000480| 72 67 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 2e |rge appl|ication.|
|00000490| 20 49 6e 20 70 61 72 74 | 69 63 75 6c 61 72 2c 20 | In part|icular, |
|000004a0| 53 61 6d 70 6c 65 20 64 | 6f 65 73 20 6e 6f 74 20 |Sample d|oes not |
|000004b0| 0d 23 09 63 6f 76 65 72 | 20 65 78 63 65 70 74 69 |.#.cover| excepti|
|000004c0| 6f 6e 20 68 61 6e 64 6c | 69 6e 67 2c 20 6d 75 6c |on handl|ing, mul|
|000004d0| 74 69 70 6c 65 20 77 69 | 6e 64 6f 77 73 2f 64 6f |tiple wi|ndows/do|
|000004e0| 63 75 6d 65 6e 74 73 2c | 20 0d 23 09 73 6f 70 68 |cuments,| .#.soph|
|000004f0| 69 73 74 69 63 61 74 65 | 64 20 6d 65 6d 6f 72 79 |isticate|d memory|
|00000500| 20 6d 61 6e 61 67 65 6d | 65 6e 74 2c 20 70 72 69 | managem|ent, pri|
|00000510| 6e 74 69 6e 67 2c 20 6f | 72 20 75 6e 64 6f 2e 20 |nting, o|r undo. |
|00000520| 41 6c 6c 20 6f 66 20 0d | 23 09 74 68 65 73 65 20 |All of .|#.these |
|00000530| 61 72 65 20 76 69 74 61 | 6c 20 70 61 72 74 73 20 |are vita|l parts |
|00000540| 6f 66 20 61 20 6e 6f 72 | 6d 61 6c 20 66 75 6c 6c |of a nor|mal full|
|00000550| 2d 73 69 7a 65 64 20 61 | 70 70 6c 69 63 61 74 69 |-sized a|pplicati|
|00000560| 6f 6e 2e 0d 23 0d 23 09 | 54 68 69 73 20 61 70 70 |on..#.#.|This app|
|00000570| 6c 69 63 61 74 69 6f 6e | 20 69 73 20 61 6e 20 65 |lication| is an e|
|00000580| 78 61 6d 70 6c 65 20 6f | 66 20 74 68 65 20 66 6f |xample o|f the fo|
|00000590| 72 6d 20 6f 66 20 61 20 | 4d 61 63 69 6e 74 6f 73 |rm of a |Macintos|
|000005a0| 68 20 0d 23 09 61 70 70 | 6c 69 63 61 74 69 6f 6e |h .#.app|lication|
|000005b0| 3b 20 69 74 20 69 73 20 | 4e 4f 54 20 61 20 74 65 |; it is |NOT a te|
|000005c0| 6d 70 6c 61 74 65 2e 20 | 49 74 20 69 73 20 4e 4f |mplate. |It is NO|
|000005d0| 54 20 69 6e 74 65 6e 64 | 65 64 20 74 6f 20 62 65 |T intend|ed to be|
|000005e0| 20 0d 23 09 75 73 65 64 | 20 61 73 20 61 20 66 6f | .#.used| as a fo|
|000005f0| 75 6e 64 61 74 69 6f 6e | 20 66 6f 72 20 74 68 65 |undation| for the|
|00000600| 20 6e 65 78 74 20 77 6f | 72 6c 64 2d 63 6c 61 73 | next wo|rld-clas|
|00000610| 73 2c 20 62 65 73 74 2d | 73 65 6c 6c 69 6e 67 2c |s, best-|selling,|
|00000620| 20 0d 23 09 36 30 30 4b | 20 61 70 70 6c 69 63 61 | .#.600K| applica|
|00000630| 74 69 6f 6e 2e 20 41 20 | 73 74 69 63 6b 20 66 69 |tion. A |stick fi|
|00000640| 67 75 72 65 20 64 72 61 | 77 69 6e 67 20 6f 66 20 |gure dra|wing of |
|00000650| 74 68 65 20 68 75 6d 61 | 6e 20 62 6f 64 79 20 6d |the huma|n body m|
|00000660| 61 79 20 0d 23 09 62 65 | 20 61 20 67 6f 6f 64 20 |ay .#.be| a good |
|00000670| 65 78 61 6d 70 6c 65 20 | 6f 66 20 74 68 65 20 66 |example |of the f|
|00000680| 6f 72 6d 20 66 6f 72 20 | 61 20 70 61 69 6e 74 69 |orm for |a painti|
|00000690| 6e 67 2c 20 62 75 74 20 | 74 68 61 74 20 64 6f 65 |ng, but |that doe|
|000006a0| 73 20 6e 6f 74 20 0d 23 | 09 6d 65 61 6e 20 69 74 |s not .#|.mean it|
|000006b0| 20 73 68 6f 75 6c 64 20 | 62 65 20 75 73 65 64 20 | should |be used |
|000006c0| 61 73 20 74 68 65 20 62 | 61 73 69 73 20 66 6f 72 |as the b|asis for|
|000006d0| 20 74 68 65 20 6e 65 78 | 74 20 4d 6f 6e 61 20 4c | the nex|t Mona L|
|000006e0| 69 73 61 2e 0d 23 0d 23 | 09 57 65 20 72 65 63 6f |isa..#.#|.We reco|
|000006f0| 6d 6d 65 6e 64 20 74 68 | 61 74 20 79 6f 75 20 72 |mmend th|at you r|
|00000700| 65 76 69 65 77 20 74 68 | 69 73 20 70 72 6f 67 72 |eview th|is progr|
|00000710| 61 6d 20 6f 72 20 53 61 | 6d 70 6c 65 20 62 65 66 |am or Sa|mple bef|
|00000720| 6f 72 65 20 0d 23 09 62 | 65 67 69 6e 6e 69 6e 67 |ore .#.b|eginning|
|00000730| 20 61 20 6e 65 77 20 61 | 70 70 6c 69 63 61 74 69 | a new a|pplicati|
|00000740| 6f 6e 2e 20 53 61 6d 70 | 6c 65 20 69 73 20 61 20 |on. Samp|le is a |
|00000750| 73 69 6d 70 6c 65 20 61 | 70 70 2e 20 77 68 69 63 |simple a|pp. whic|
|00000760| 68 20 64 6f 65 73 6e d5 | 74 20 0d 23 09 75 73 65 |h doesn.|t .#.use|
|00000770| 20 54 65 78 74 45 64 69 | 74 20 6f 72 20 74 68 65 | TextEdi|t or the|
|00000780| 20 43 6f 6e 74 72 6f 6c | 20 4d 61 6e 61 67 65 72 | Control| Manager|
|00000790| 2e 0d 23 0d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |..#.----|--------|
|000007a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000007e0| 2d 2d 2a 2f 0d 0d 0d 2f | 2a 20 53 65 67 6d 65 6e |--*/.../|* Segmen|
|000007f0| 74 61 74 69 6f 6e 20 73 | 74 72 61 74 65 67 79 3a |tation s|trategy:|
|00000800| 0d 0d 20 20 20 54 68 69 | 73 20 70 72 6f 67 72 61 |.. Thi|s progra|
|00000810| 6d 20 63 6f 6e 73 69 73 | 74 73 20 6f 66 20 74 68 |m consis|ts of th|
|00000820| 72 65 65 20 73 65 67 6d | 65 6e 74 73 2e 20 4d 61 |ree segm|ents. Ma|
|00000830| 69 6e 20 63 6f 6e 74 61 | 69 6e 73 20 6d 6f 73 74 |in conta|ins most|
|00000840| 20 6f 66 20 74 68 65 20 | 63 6f 64 65 2c 0d 20 20 | of the |code,. |
|00000850| 20 69 6e 63 6c 75 64 69 | 6e 67 20 74 68 65 20 4d | includi|ng the M|
|00000860| 50 57 20 6c 69 62 72 61 | 72 69 65 73 2c 20 61 6e |PW libra|ries, an|
|00000870| 64 20 74 68 65 20 6d 61 | 69 6e 20 70 72 6f 67 72 |d the ma|in progr|
|00000880| 61 6d 2e 20 49 6e 69 74 | 69 61 6c 69 7a 65 20 63 |am. Init|ialize c|
|00000890| 6f 6e 74 61 69 6e 73 0d | 20 20 20 63 6f 64 65 20 |ontains.| code |
|000008a0| 74 68 61 74 20 69 73 20 | 6f 6e 6c 79 20 75 73 65 |that is |only use|
|000008b0| 64 20 6f 6e 63 65 2c 20 | 64 75 72 69 6e 67 20 73 |d once, |during s|
|000008c0| 74 61 72 74 75 70 2c 20 | 61 6e 64 20 63 61 6e 20 |tartup, |and can |
|000008d0| 62 65 20 75 6e 6c 6f 61 | 64 65 64 20 61 66 74 65 |be unloa|ded afte|
|000008e0| 72 20 74 68 65 0d 20 20 | 20 70 72 6f 67 72 61 6d |r the. | program|
|000008f0| 20 73 74 61 72 74 73 2e | 20 25 41 35 49 6e 69 74 | starts.| %A5Init|
|00000900| 20 69 73 20 61 75 74 6f | 6d 61 74 69 63 61 6c 6c | is auto|maticall|
|00000910| 79 20 63 72 65 61 74 65 | 64 20 62 79 20 74 68 65 |y create|d by the|
|00000920| 20 4c 69 6e 6b 65 72 20 | 74 6f 20 69 6e 69 74 69 | Linker |to initi|
|00000930| 61 6c 69 7a 65 0d 20 20 | 20 67 6c 6f 62 61 6c 73 |alize. | globals|
|00000940| 20 66 6f 72 20 74 68 65 | 20 4d 50 57 20 6c 69 62 | for the| MPW lib|
|00000950| 72 61 72 69 65 73 20 61 | 6e 64 20 69 73 20 75 6e |raries a|nd is un|
|00000960| 6c 6f 61 64 65 64 20 72 | 69 67 68 74 20 61 77 61 |loaded r|ight awa|
|00000970| 79 2e 20 2a 2f 0d 0d 0d | 2f 2a 20 53 65 74 50 6f |y. */...|/* SetPo|
|00000980| 72 74 20 73 74 72 61 74 | 65 67 79 3a 0d 0d 20 20 |rt strat|egy:.. |
|00000990| 20 54 6f 6f 6c 62 6f 78 | 20 72 6f 75 74 69 6e 65 | Toolbox| routine|
|000009a0| 73 20 64 6f 20 6e 6f 74 | 20 63 68 61 6e 67 65 20 |s do not| change |
|000009b0| 74 68 65 20 63 75 72 72 | 65 6e 74 20 70 6f 72 74 |the curr|ent port|
|000009c0| 2e 20 49 6e 20 73 70 69 | 74 65 20 6f 66 20 74 68 |. In spi|te of th|
|000009d0| 69 73 2c 20 69 6e 20 74 | 68 69 73 0d 20 20 20 70 |is, in t|his. p|
|000009e0| 72 6f 67 72 61 6d 20 77 | 65 20 75 73 65 20 61 20 |rogram w|e use a |
|000009f0| 73 74 72 61 74 65 67 79 | 20 6f 66 20 63 61 6c 6c |strategy| of call|
|00000a00| 69 6e 67 20 53 65 74 50 | 6f 72 74 20 77 68 65 6e |ing SetP|ort when|
|00000a10| 65 76 65 72 20 77 65 20 | 77 61 6e 74 20 74 6f 20 |ever we |want to |
|00000a20| 64 72 61 77 20 6f 72 0d | 20 20 20 6d 61 6b 65 20 |draw or.| make |
|00000a30| 63 61 6c 6c 73 20 77 68 | 69 63 68 20 64 65 70 65 |calls wh|ich depe|
|00000a40| 6e 64 20 6f 6e 20 74 68 | 65 20 63 75 72 72 65 6e |nd on th|e curren|
|00000a50| 74 20 70 6f 72 74 2e 20 | 54 68 69 73 20 6d 61 6b |t port. |This mak|
|00000a60| 65 73 20 75 73 20 6c 65 | 73 73 20 76 75 6c 6e 65 |es us le|ss vulne|
|00000a70| 72 61 62 6c 65 0d 20 20 | 20 74 6f 20 62 75 67 73 |rable. | to bugs|
|00000a80| 20 69 6e 20 6f 74 68 65 | 72 20 73 6f 66 74 77 61 | in othe|r softwa|
|00000a90| 72 65 20 77 68 69 63 68 | 20 6d 69 67 68 74 20 61 |re which| might a|
|00000aa0| 6c 74 65 72 20 74 68 65 | 20 63 75 72 72 65 6e 74 |lter the| current|
|00000ab0| 20 70 6f 72 74 20 28 73 | 75 63 68 20 61 73 20 74 | port (s|uch as t|
|00000ac0| 68 65 0d 20 20 20 62 75 | 67 20 28 66 65 61 74 75 |he. bu|g (featu|
|00000ad0| 72 65 3f 29 20 69 6e 20 | 6d 61 6e 79 20 64 65 73 |re?) in |many des|
|00000ae0| 6b 20 61 63 63 65 73 73 | 6f 72 69 65 73 20 77 68 |k access|ories wh|
|00000af0| 69 63 68 20 63 68 61 6e | 67 65 20 74 68 65 20 70 |ich chan|ge the p|
|00000b00| 6f 72 74 20 6f 6e 20 4f | 70 65 6e 44 65 73 6b 41 |ort on O|penDeskA|
|00000b10| 63 63 29 2e 0d 20 20 20 | 48 6f 70 65 66 75 6c 6c |cc).. |Hopefull|
|00000b20| 79 2c 20 74 68 69 73 20 | 61 6c 73 6f 20 6d 61 6b |y, this |also mak|
|00000b30| 65 73 20 74 68 65 20 72 | 6f 75 74 69 6e 65 73 20 |es the r|outines |
|00000b40| 66 72 6f 6d 20 74 68 69 | 73 20 70 72 6f 67 72 61 |from thi|s progra|
|00000b50| 6d 20 6d 6f 72 65 20 73 | 65 6c 66 2d 63 6f 6e 74 |m more s|elf-cont|
|00000b60| 61 69 6e 65 64 2c 0d 20 | 20 20 73 69 6e 63 65 20 |ained,. | since |
|00000b70| 74 68 65 79 20 64 6f 6e | 27 74 20 64 65 70 65 6e |they don|'t depen|
|00000b80| 64 20 6f 6e 20 74 68 65 | 20 63 75 72 72 65 6e 74 |d on the| current|
|00000b90| 20 70 6f 72 74 20 73 65 | 74 74 69 6e 67 2e 20 2a | port se|tting. *|
|00000ba0| 2f 0d 0d 0d 2f 2a 20 43 | 6c 69 70 62 6f 61 72 64 |/.../* C|lipboard|
|00000bb0| 20 73 74 72 61 74 65 67 | 79 3a 0d 0d 20 20 20 54 | strateg|y:.. T|
|00000bc0| 68 69 73 20 70 72 6f 67 | 72 61 6d 20 64 6f 65 73 |his prog|ram does|
|00000bd0| 20 6e 6f 74 20 6d 61 69 | 6e 74 61 69 6e 20 61 20 | not mai|ntain a |
|00000be0| 70 72 69 76 61 74 65 20 | 73 63 72 61 70 2e 20 57 |private |scrap. W|
|00000bf0| 68 65 6e 65 76 65 72 20 | 61 20 63 75 74 2c 20 63 |henever |a cut, c|
|00000c00| 6f 70 79 2c 20 6f 72 20 | 70 61 73 74 65 0d 20 20 |opy, or |paste. |
|00000c10| 20 6f 63 63 75 72 73 2c | 20 77 65 20 69 6d 70 6f | occurs,| we impo|
|00000c20| 72 74 2f 65 78 70 6f 72 | 74 20 66 72 6f 6d 20 74 |rt/expor|t from t|
|00000c30| 68 65 20 70 75 62 6c 69 | 63 20 73 63 72 61 70 20 |he publi|c scrap |
|00000c40| 74 6f 20 54 65 78 74 45 | 64 69 74 27 73 20 73 63 |to TextE|dit's sc|
|00000c50| 72 61 70 20 72 69 67 68 | 74 20 61 77 61 79 2c 0d |rap righ|t away,.|
|00000c60| 20 20 20 75 73 69 6e 67 | 20 74 68 65 20 54 45 54 | using| the TET|
|00000c70| 6f 53 63 72 61 70 20 61 | 6e 64 20 54 45 46 72 6f |oScrap a|nd TEFro|
|00000c80| 6d 53 63 72 61 70 20 72 | 6f 75 74 69 6e 65 73 2e |mScrap r|outines.|
|00000c90| 20 49 66 20 77 65 20 64 | 69 64 20 75 73 65 20 61 | If we d|id use a|
|00000ca0| 20 70 72 69 76 61 74 65 | 20 73 63 72 61 70 2c 0d | private| scrap,.|
|00000cb0| 20 20 20 74 68 65 20 69 | 6d 70 6f 72 74 2f 65 78 | the i|mport/ex|
|00000cc0| 70 6f 72 74 20 77 6f 75 | 6c 64 20 62 65 20 69 6e |port wou|ld be in|
|00000cd0| 20 74 68 65 20 61 63 74 | 69 76 61 74 65 2f 64 65 | the act|ivate/de|
|00000ce0| 61 63 74 69 76 61 74 65 | 20 65 76 65 6e 74 20 61 |activate| event a|
|00000cf0| 6e 64 20 73 75 73 70 65 | 6e 64 2f 72 65 73 75 6d |nd suspe|nd/resum|
|00000d00| 65 0d 20 20 20 65 76 65 | 6e 74 20 72 6f 75 74 69 |e. eve|nt routi|
|00000d10| 6e 65 73 2e 20 2a 2f 0d | 0d 0d 23 69 6e 63 6c 75 |nes. */.|..#inclu|
|00000d20| 64 65 20 3c 56 61 6c 75 | 65 73 2e 68 3e 0d 23 69 |de <Valu|es.h>.#i|
|00000d30| 6e 63 6c 75 64 65 20 3c | 54 79 70 65 73 2e 68 3e |nclude <|Types.h>|
|00000d40| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 51 75 69 63 6b |.#includ|e <Quick|
|00000d50| 44 72 61 77 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |Draw.h>.|#include|
|00000d60| 20 3c 46 6f 6e 74 73 2e | 68 3e 0d 23 69 6e 63 6c | <Fonts.|h>.#incl|
|00000d70| 75 64 65 20 3c 45 76 65 | 6e 74 73 2e 68 3e 0d 23 |ude <Eve|nts.h>.#|
|00000d80| 69 6e 63 6c 75 64 65 20 | 3c 43 6f 6e 74 72 6f 6c |include |<Control|
|00000d90| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 57 |s.h>.#in|clude <W|
|00000da0| 69 6e 64 6f 77 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |indows.h|>.#inclu|
|00000db0| 64 65 20 3c 4d 65 6e 75 | 73 2e 68 3e 0d 23 69 6e |de <Menu|s.h>.#in|
|00000dc0| 63 6c 75 64 65 20 3c 54 | 65 78 74 45 64 69 74 2e |clude <T|extEdit.|
|00000dd0| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 44 69 61 |h>.#incl|ude <Dia|
|00000de0| 6c 6f 67 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |logs.h>.|#include|
|00000df0| 20 3c 44 65 73 6b 2e 68 | 3e 0d 23 69 6e 63 6c 75 | <Desk.h|>.#inclu|
|00000e00| 64 65 20 3c 53 63 72 61 | 70 2e 68 3e 0d 23 69 6e |de <Scra|p.h>.#in|
|00000e10| 63 6c 75 64 65 20 3c 54 | 6f 6f 6c 55 74 69 6c 73 |clude <T|oolUtils|
|00000e20| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 4d 65 |.h>.#inc|lude <Me|
|00000e30| 6d 6f 72 79 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |mory.h>.|#include|
|00000e40| 20 3c 53 65 67 4c 6f 61 | 64 2e 68 3e 0d 23 69 6e | <SegLoa|d.h>.#in|
|00000e50| 63 6c 75 64 65 20 3c 46 | 69 6c 65 73 2e 68 3e 0d |clude <F|iles.h>.|
|00000e60| 23 69 6e 63 6c 75 64 65 | 20 3c 4f 53 55 74 69 6c |#include| <OSUtil|
|00000e70| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 54 |s.h>.#in|clude <T|
|00000e80| 72 61 70 73 2e 68 3e 09 | 09 2f 2a 20 4d 50 57 20 |raps.h>.|./* MPW |
|00000e90| 32 2e 30 2e 32 20 54 72 | 61 70 73 2e 68 20 69 73 |2.0.2 Tr|aps.h is|
|00000ea0| 20 6d 69 73 73 69 6e 67 | 20 61 6e 20 23 65 6e 64 | missing| an #end|
|00000eb0| 69 66 20 2a 2f 0d 23 69 | 6e 63 6c 75 64 65 20 3c |if */.#i|nclude <|
|00000ec0| 54 45 53 61 6d 70 6c 65 | 2e 68 3e 20 20 20 20 20 |TESample|.h> |
|00000ed0| 2f 2a 20 62 72 69 6e 67 | 20 69 6e 20 61 6c 6c 20 |/* bring| in all |
|00000ee0| 74 68 65 20 23 64 65 66 | 69 6e 65 73 20 66 6f 72 |the #def|ines for|
|00000ef0| 20 53 61 6d 70 6c 65 20 | 2a 2f 0d 0d 0d 2f 2a 20 | Sample |*/.../* |
|00000f00| 41 20 44 6f 63 75 6d 65 | 6e 74 52 65 63 6f 72 64 |A Docume|ntRecord|
|00000f10| 20 63 6f 6e 74 61 69 6e | 73 20 74 68 65 20 57 69 | contain|s the Wi|
|00000f20| 6e 64 6f 77 52 65 63 6f | 72 64 20 66 6f 72 20 6f |ndowReco|rd for o|
|00000f30| 6e 65 20 6f 66 20 6f 75 | 72 20 64 6f 63 75 6d 65 |ne of ou|r docume|
|00000f40| 6e 74 20 77 69 6e 64 6f | 77 73 2c 0d 20 20 20 61 |nt windo|ws,. a|
|00000f50| 73 20 77 65 6c 6c 20 61 | 73 20 74 68 65 20 54 45 |s well a|s the TE|
|00000f60| 48 61 6e 64 6c 65 20 66 | 6f 72 20 74 68 65 20 74 |Handle f|or the t|
|00000f70| 65 78 74 20 77 65 20 61 | 72 65 20 65 64 69 74 69 |ext we a|re editi|
|00000f80| 6e 67 2e 20 4f 74 68 65 | 72 20 64 6f 63 75 6d 65 |ng. Othe|r docume|
|00000f90| 6e 74 20 66 69 65 6c 64 | 73 0d 20 20 20 63 61 6e |nt field|s. can|
|00000fa0| 20 62 65 20 61 64 64 65 | 64 20 74 6f 20 74 68 69 | be adde|d to thi|
|00000fb0| 73 20 72 65 63 6f 72 64 | 20 61 73 20 6e 65 65 64 |s record| as need|
|00000fc0| 65 64 2e 20 46 6f 72 20 | 61 20 73 69 6d 69 6c 61 |ed. For |a simila|
|00000fd0| 72 20 65 78 61 6d 70 6c | 65 2c 20 73 65 65 20 68 |r exampl|e, see h|
|00000fe0| 6f 77 20 74 68 65 0d 20 | 20 20 57 69 6e 64 6f 77 |ow the. | Window|
|00000ff0| 20 4d 61 6e 61 67 65 72 | 20 61 6e 64 20 44 69 61 | Manager| and Dia|
|00001000| 6c 6f 67 20 4d 61 6e 61 | 67 65 72 20 61 64 64 20 |log Mana|ger add |
|00001010| 66 69 65 6c 64 73 20 61 | 66 74 65 72 20 74 68 65 |fields a|fter the|
|00001020| 20 47 72 61 66 50 6f 72 | 74 2e 20 2a 2f 0d 74 79 | GrafPor|t. */.ty|
|00001030| 70 65 64 65 66 20 73 74 | 72 75 63 74 20 7b 0d 09 |pedef st|ruct {..|
|00001040| 57 69 6e 64 6f 77 52 65 | 63 6f 72 64 09 64 6f 63 |WindowRe|cord.doc|
|00001050| 57 69 6e 64 6f 77 3b 0d | 09 54 45 48 61 6e 64 6c |Window;.|.TEHandl|
|00001060| 65 09 09 64 6f 63 54 45 | 3b 0d 09 43 6f 6e 74 72 |e..docTE|;..Contr|
|00001070| 6f 6c 48 61 6e 64 6c 65 | 09 64 6f 63 56 53 63 72 |olHandle|.docVScr|
|00001080| 6f 6c 6c 3b 0d 09 43 6f | 6e 74 72 6f 6c 48 61 6e |oll;..Co|ntrolHan|
|00001090| 64 6c 65 09 64 6f 63 48 | 53 63 72 6f 6c 6c 3b 0d |dle.docH|Scroll;.|
|000010a0| 09 50 72 6f 63 50 74 72 | 09 09 09 64 6f 63 43 6c |.ProcPtr|...docCl|
|000010b0| 69 6b 3b 0d 7d 20 44 6f | 63 75 6d 65 6e 74 52 65 |ik;.} Do|cumentRe|
|000010c0| 63 6f 72 64 2c 20 2a 44 | 6f 63 75 6d 65 6e 74 50 |cord, *D|ocumentP|
|000010d0| 65 65 6b 3b 0d 0d 0d 0d | 2f 2a 20 54 68 65 20 22 |eek;....|/* The "|
|000010e0| 67 22 20 70 72 65 66 69 | 78 20 69 73 20 75 73 65 |g" prefi|x is use|
|000010f0| 64 20 74 6f 20 65 6d 70 | 68 61 73 69 7a 65 20 74 |d to emp|hasize t|
|00001100| 68 61 74 20 61 20 76 61 | 72 69 61 62 6c 65 20 69 |hat a va|riable i|
|00001110| 73 20 67 6c 6f 62 61 6c | 2e 20 2a 2f 0d 0d 2f 2a |s global|. */../*|
|00001120| 20 47 4d 61 63 20 69 73 | 20 75 73 65 64 20 74 6f | GMac is| used to|
|00001130| 20 68 6f 6c 64 20 74 68 | 65 20 72 65 73 75 6c 74 | hold th|e result|
|00001140| 20 6f 66 20 61 20 53 79 | 73 45 6e 76 69 72 6f 6e | of a Sy|sEnviron|
|00001150| 73 20 63 61 6c 6c 2e 20 | 54 68 69 73 20 6d 61 6b |s call. |This mak|
|00001160| 65 73 0d 20 20 20 69 74 | 20 63 6f 6e 76 65 6e 69 |es. it| conveni|
|00001170| 65 6e 74 20 66 6f 72 20 | 61 6e 79 20 72 6f 75 74 |ent for |any rout|
|00001180| 69 6e 65 20 74 6f 20 63 | 68 65 63 6b 20 74 68 65 |ine to c|heck the|
|00001190| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 2e 20 2a 2f | environ|ment. */|
|000011a0| 0d 53 79 73 45 6e 76 52 | 65 63 09 67 4d 61 63 3b |.SysEnvR|ec.gMac;|
|000011b0| 09 09 09 09 2f 2a 20 73 | 65 74 20 75 70 20 62 79 |..../* s|et up by|
|000011c0| 20 49 6e 69 74 69 61 6c | 69 7a 65 20 2a 2f 0d 0d | Initial|ize */..|
|000011d0| 2f 2a 20 47 48 61 73 57 | 61 69 74 4e 65 78 74 45 |/* GHasW|aitNextE|
|000011e0| 76 65 6e 74 20 69 73 20 | 73 65 74 20 61 74 20 73 |vent is |set at s|
|000011f0| 74 61 72 74 75 70 2c 20 | 61 6e 64 20 74 65 6c 6c |tartup, |and tell|
|00001200| 73 20 77 68 65 74 68 65 | 72 20 74 68 65 20 57 61 |s whethe|r the Wa|
|00001210| 69 74 4e 65 78 74 45 76 | 65 6e 74 0d 20 20 20 74 |itNextEv|ent. t|
|00001220| 72 61 70 20 69 73 20 61 | 76 61 69 6c 61 62 6c 65 |rap is a|vailable|
|00001230| 2e 20 49 66 20 69 74 20 | 69 73 20 66 61 6c 73 65 |. If it |is false|
|00001240| 2c 20 77 65 20 6b 6e 6f | 77 20 74 68 61 74 20 77 |, we kno|w that w|
|00001250| 65 20 6d 75 73 74 20 63 | 61 6c 6c 20 47 65 74 4e |e must c|all GetN|
|00001260| 65 78 74 45 76 65 6e 74 | 2e 20 2a 2f 0d 42 6f 6f |extEvent|. */.Boo|
|00001270| 6c 65 61 6e 09 09 67 48 | 61 73 57 61 69 74 4e 65 |lean..gH|asWaitNe|
|00001280| 78 74 45 76 65 6e 74 3b | 09 2f 2a 20 73 65 74 20 |xtEvent;|./* set |
|00001290| 75 70 20 62 79 20 49 6e | 69 74 69 61 6c 69 7a 65 |up by In|itialize|
|000012a0| 20 2a 2f 0d 0d 2f 2a 20 | 47 49 6e 42 61 63 6b 67 | */../* |GInBackg|
|000012b0| 72 6f 75 6e 64 20 69 73 | 20 6d 61 69 6e 74 61 69 |round is| maintai|
|000012c0| 6e 65 64 20 62 79 20 6f | 75 72 20 6f 73 45 76 65 |ned by o|ur osEve|
|000012d0| 6e 74 20 68 61 6e 64 6c | 69 6e 67 20 72 6f 75 74 |nt handl|ing rout|
|000012e0| 69 6e 65 73 2e 20 41 6e | 79 20 70 61 72 74 20 6f |ines. An|y part o|
|000012f0| 66 0d 20 20 20 74 68 65 | 20 70 72 6f 67 72 61 6d |f. the| program|
|00001300| 20 63 61 6e 20 63 68 65 | 63 6b 20 69 74 20 74 6f | can che|ck it to|
|00001310| 20 66 69 6e 64 20 6f 75 | 74 20 69 66 20 69 74 20 | find ou|t if it |
|00001320| 69 73 20 63 75 72 72 65 | 6e 74 6c 79 20 69 6e 20 |is curre|ntly in |
|00001330| 74 68 65 20 62 61 63 6b | 67 72 6f 75 6e 64 2e 20 |the back|ground. |
|00001340| 2a 2f 0d 42 6f 6f 6c 65 | 61 6e 09 09 67 49 6e 42 |*/.Boole|an..gInB|
|00001350| 61 63 6b 67 72 6f 75 6e | 64 3b 09 09 2f 2a 20 6d |ackgroun|d;../* m|
|00001360| 61 69 6e 74 61 69 6e 65 | 64 20 62 79 20 49 6e 69 |aintaine|d by Ini|
|00001370| 74 69 61 6c 69 7a 65 20 | 61 6e 64 20 44 6f 45 76 |tialize |and DoEv|
|00001380| 65 6e 74 20 2a 2f 0d 0d | 2f 2a 20 47 4e 75 6d 44 |ent */..|/* GNumD|
|00001390| 6f 63 75 6d 65 6e 74 73 | 20 69 73 20 75 73 65 64 |ocuments| is used|
|000013a0| 20 74 6f 20 6b 65 65 70 | 20 74 72 61 63 6b 20 6f | to keep| track o|
|000013b0| 66 20 68 6f 77 20 6d 61 | 6e 79 20 6f 70 65 6e 20 |f how ma|ny open |
|000013c0| 64 6f 63 75 6d 65 6e 74 | 73 20 74 68 65 72 65 20 |document|s there |
|000013d0| 61 72 65 0d 20 20 20 61 | 74 20 61 6e 79 20 74 69 |are. a|t any ti|
|000013e0| 6d 65 2e 20 49 74 20 69 | 73 20 6d 61 69 6e 74 61 |me. It i|s mainta|
|000013f0| 69 6e 65 64 20 62 79 20 | 74 68 65 20 72 6f 75 74 |ined by |the rout|
|00001400| 69 6e 65 73 20 74 68 61 | 74 20 6f 70 65 6e 20 61 |ines tha|t open a|
|00001410| 6e 64 20 63 6c 6f 73 65 | 20 64 6f 63 75 6d 65 6e |nd close| documen|
|00001420| 74 73 2e 20 2a 2f 0d 73 | 68 6f 72 74 09 09 67 4e |ts. */.s|hort..gN|
|00001430| 75 6d 44 6f 63 75 6d 65 | 6e 74 73 3b 09 09 2f 2a |umDocume|nts;../*|
|00001440| 20 6d 61 69 6e 74 61 69 | 6e 65 64 20 62 79 20 49 | maintai|ned by I|
|00001450| 6e 69 74 69 61 6c 69 7a | 65 2c 20 44 6f 4e 65 77 |nitializ|e, DoNew|
|00001460| 2c 20 61 6e 64 20 44 6f | 43 6c 6f 73 65 57 69 6e |, and Do|CloseWin|
|00001470| 64 6f 77 20 2a 2f 0d 0d | 0d 2f 2a 20 48 65 72 65 |dow */..|./* Here|
|00001480| 20 61 72 65 20 64 65 63 | 6c 61 72 61 74 69 6f 6e | are dec|laration|
|00001490| 73 20 66 6f 72 20 61 6c | 6c 20 6f 66 20 74 68 65 |s for al|l of the|
|000014a0| 20 43 20 72 6f 75 74 69 | 6e 65 73 2e 20 49 6e 20 | C routi|nes. In |
|000014b0| 4d 50 57 20 33 2e 30 20 | 77 65 20 63 61 6e 20 75 |MPW 3.0 |we can u|
|000014c0| 73 65 0d 20 20 20 61 63 | 74 75 61 6c 20 70 72 6f |se. ac|tual pro|
|000014d0| 74 6f 74 79 70 65 73 20 | 66 6f 72 20 70 61 72 61 |totypes |for para|
|000014e0| 6d 65 74 65 72 20 74 79 | 70 65 20 63 68 65 63 6b |meter ty|pe check|
|000014f0| 69 6e 67 2e 20 2a 2f 0d | 23 69 66 6e 64 65 66 20 |ing. */.|#ifndef |
|00001500| 4d 50 57 33 0d 09 76 6f | 69 64 20 45 76 65 6e 74 |MPW3..vo|id Event|
|00001510| 4c 6f 6f 70 28 29 3b 0d | 09 76 6f 69 64 20 44 6f |Loop();.|.void Do|
|00001520| 45 76 65 6e 74 28 20 2f | 2a 20 45 76 65 6e 74 52 |Event( /|* EventR|
|00001530| 65 63 6f 72 64 20 2a 65 | 76 65 6e 74 20 2a 2f 20 |ecord *e|vent */ |
|00001540| 29 3b 0d 09 76 6f 69 64 | 20 41 64 6a 75 73 74 43 |);..void| AdjustC|
|00001550| 75 72 73 6f 72 28 20 2f | 2a 20 50 6f 69 6e 74 20 |ursor( /|* Point |
|00001560| 6d 6f 75 73 65 2c 20 52 | 67 6e 48 61 6e 64 6c 65 |mouse, R|gnHandle|
|00001570| 20 72 65 67 69 6f 6e 20 | 2a 2f 20 29 3b 0d 09 76 | region |*/ );..v|
|00001580| 6f 69 64 20 44 6f 47 72 | 6f 77 57 69 6e 64 6f 77 |oid DoGr|owWindow|
|00001590| 28 20 2f 2a 20 57 69 6e | 64 6f 77 50 74 72 20 77 |( /* Win|dowPtr w|
|000015a0| 69 6e 64 6f 77 2c 20 45 | 76 65 6e 74 52 65 63 6f |indow, E|ventReco|
|000015b0| 72 64 20 2a 65 76 65 6e | 74 20 2a 2f 20 29 3b 0d |rd *even|t */ );.|
|000015c0| 09 76 6f 69 64 20 44 6f | 5a 6f 6f 6d 57 69 6e 64 |.void Do|ZoomWind|
|000015d0| 6f 77 28 20 2f 2a 20 57 | 69 6e 64 6f 77 50 74 72 |ow( /* W|indowPtr|
|000015e0| 20 77 69 6e 64 6f 77 2c | 20 73 68 6f 72 74 20 70 | window,| short p|
|000015f0| 61 72 74 20 2a 2f 20 29 | 3b 0d 09 76 6f 69 64 20 |art */ )|;..void |
|00001600| 52 65 73 69 7a 65 57 69 | 6e 64 6f 77 28 20 2f 2a |ResizeWi|ndow( /*|
|00001610| 20 57 69 6e 64 6f 77 50 | 74 72 20 77 69 6e 64 6f | WindowP|tr windo|
|00001620| 77 20 2a 2f 20 29 3b 0d | 09 76 6f 69 64 20 47 65 |w */ );.|.void Ge|
|00001630| 74 4c 6f 63 61 6c 55 70 | 64 61 74 65 52 67 6e 28 |tLocalUp|dateRgn(|
|00001640| 20 2f 2a 20 57 69 6e 64 | 6f 77 50 74 72 20 77 69 | /* Wind|owPtr wi|
|00001650| 6e 64 6f 77 2c 20 52 67 | 6e 48 61 6e 64 6c 65 20 |ndow, Rg|nHandle |
|00001660| 6c 6f 63 61 6c 52 67 6e | 20 2a 2f 20 29 3b 0d 09 |localRgn| */ );..|
|00001670| 76 6f 69 64 20 44 6f 55 | 70 64 61 74 65 28 20 2f |void DoU|pdate( /|
|00001680| 2a 20 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |* Window|Ptr wind|
|00001690| 6f 77 20 2a 2f 20 29 3b | 0d 09 76 6f 69 64 20 44 |ow */ );|..void D|
|000016a0| 6f 44 65 61 63 74 69 76 | 61 74 65 28 20 2f 2a 20 |oDeactiv|ate( /* |
|000016b0| 57 69 6e 64 6f 77 50 74 | 72 20 77 69 6e 64 6f 77 |WindowPt|r window|
|000016c0| 20 2a 2f 20 29 3b 0d 09 | 76 6f 69 64 20 44 6f 41 | */ );..|void DoA|
|000016d0| 63 74 69 76 61 74 65 28 | 20 2f 2a 20 57 69 6e 64 |ctivate(| /* Wind|
|000016e0| 6f 77 50 74 72 20 77 69 | 6e 64 6f 77 2c 20 42 6f |owPtr wi|ndow, Bo|
|000016f0| 6f 6c 65 61 6e 20 62 65 | 63 6f 6d 69 6e 67 41 63 |olean be|comingAc|
|00001700| 74 69 76 65 20 2a 2f 20 | 29 3b 0d 09 76 6f 69 64 |tive */ |);..void|
|00001710| 20 44 6f 43 6f 6e 74 65 | 6e 74 43 6c 69 63 6b 28 | DoConte|ntClick(|
|00001720| 20 2f 2a 20 57 69 6e 64 | 6f 77 50 74 72 20 77 69 | /* Wind|owPtr wi|
|00001730| 6e 64 6f 77 2c 20 45 76 | 65 6e 74 52 65 63 6f 72 |ndow, Ev|entRecor|
|00001740| 64 20 2a 65 76 65 6e 74 | 20 2a 2f 20 29 3b 0d 09 |d *event| */ );..|
|00001750| 76 6f 69 64 20 44 6f 4b | 65 79 44 6f 77 6e 28 20 |void DoK|eyDown( |
|00001760| 2f 2a 20 45 76 65 6e 74 | 52 65 63 6f 72 64 20 2a |/* Event|Record *|
|00001770| 65 76 65 6e 74 20 2a 2f | 20 29 3b 0d 09 75 6e 73 |event */| );..uns|
|00001780| 69 67 6e 65 64 20 6c 6f | 6e 67 20 47 65 74 53 6c |igned lo|ng GetSl|
|00001790| 65 65 70 28 29 3b 0d 09 | 76 6f 69 64 20 43 6f 6d |eep();..|void Com|
|000017a0| 6d 6f 6e 41 63 74 69 6f | 6e 28 20 2f 2a 20 43 6f |monActio|n( /* Co|
|000017b0| 6e 74 72 6f 6c 48 61 6e | 64 6c 65 20 63 6f 6e 74 |ntrolHan|dle cont|
|000017c0| 72 6f 6c 2c 20 73 68 6f | 72 74 20 2a 61 6d 6f 75 |rol, sho|rt *amou|
|000017d0| 6e 74 20 2a 2f 20 29 3b | 0d 09 70 61 73 63 61 6c |nt */ );|..pascal|
|000017e0| 20 76 6f 69 64 20 56 41 | 63 74 69 6f 6e 50 72 6f | void VA|ctionPro|
|000017f0| 63 28 20 2f 2a 20 43 6f | 6e 74 72 6f 6c 48 61 6e |c( /* Co|ntrolHan|
|00001800| 64 6c 65 20 63 6f 6e 74 | 72 6f 6c 2c 20 73 68 6f |dle cont|rol, sho|
|00001810| 72 74 20 70 61 72 74 20 | 2a 2f 20 29 3b 0d 09 70 |rt part |*/ );..p|
|00001820| 61 73 63 61 6c 20 76 6f | 69 64 20 48 41 63 74 69 |ascal vo|id HActi|
|00001830| 6f 6e 50 72 6f 63 28 20 | 2f 2a 20 43 6f 6e 74 72 |onProc( |/* Contr|
|00001840| 6f 6c 48 61 6e 64 6c 65 | 20 63 6f 6e 74 72 6f 6c |olHandle| control|
|00001850| 2c 20 73 68 6f 72 74 20 | 70 61 72 74 20 2a 2f 20 |, short |part */ |
|00001860| 29 3b 0d 09 76 6f 69 64 | 20 44 6f 49 64 6c 65 28 |);..void| DoIdle(|
|00001870| 29 3b 0d 09 76 6f 69 64 | 20 44 72 61 77 57 69 6e |);..void| DrawWin|
|00001880| 64 6f 77 28 20 2f 2a 20 | 57 69 6e 64 6f 77 50 74 |dow( /* |WindowPt|
|00001890| 72 20 77 69 6e 64 6f 77 | 20 2a 2f 20 29 3b 0d 09 |r window| */ );..|
|000018a0| 76 6f 69 64 20 41 64 6a | 75 73 74 4d 65 6e 75 73 |void Adj|ustMenus|
|000018b0| 28 29 3b 0d 09 76 6f 69 | 64 20 44 6f 4d 65 6e 75 |();..voi|d DoMenu|
|000018c0| 43 6f 6d 6d 61 6e 64 28 | 20 2f 2a 20 6c 6f 6e 67 |Command(| /* long|
|000018d0| 20 6d 65 6e 75 52 65 73 | 75 6c 74 20 2a 2f 20 29 | menuRes|ult */ )|
|000018e0| 3b 0d 09 76 6f 69 64 20 | 44 6f 4e 65 77 28 29 3b |;..void |DoNew();|
|000018f0| 0d 09 76 6f 69 64 20 44 | 6f 43 6c 6f 73 65 57 69 |..void D|oCloseWi|
|00001900| 6e 64 6f 77 28 20 2f 2a | 20 57 69 6e 64 6f 77 50 |ndow( /*| WindowP|
|00001910| 74 72 20 77 69 6e 64 6f | 77 20 2a 2f 20 29 3b 0d |tr windo|w */ );.|
|00001920| 09 76 6f 69 64 20 44 6f | 43 6c 6f 73 65 42 65 68 |.void Do|CloseBeh|
|00001930| 69 6e 64 28 20 2f 2a 20 | 57 69 6e 64 6f 77 50 74 |ind( /* |WindowPt|
|00001940| 72 20 77 69 6e 64 6f 77 | 20 2a 2f 20 29 3b 0d 09 |r window| */ );..|
|00001950| 76 6f 69 64 20 54 65 72 | 6d 69 6e 61 74 65 28 29 |void Ter|minate()|
|00001960| 3b 0d 09 76 6f 69 64 20 | 49 6e 69 74 69 61 6c 69 |;..void |Initiali|
|00001970| 7a 65 28 29 3b 0d 09 76 | 6f 69 64 20 46 6f 72 63 |ze();..v|oid Forc|
|00001980| 65 45 6e 76 69 72 6f 6e | 73 28 29 3b 0d 09 76 6f |eEnviron|s();..vo|
|00001990| 69 64 20 47 65 74 54 45 | 52 65 63 74 28 20 2f 2a |id GetTE|Rect( /*|
|000019a0| 20 57 69 6e 64 6f 77 50 | 74 72 20 77 69 6e 64 6f | WindowP|tr windo|
|000019b0| 77 2c 20 52 65 63 74 20 | 2a 74 65 52 65 63 74 20 |w, Rect |*teRect |
|000019c0| 2a 2f 20 29 3b 0d 09 76 | 6f 69 64 20 41 64 6a 75 |*/ );..v|oid Adju|
|000019d0| 73 74 56 69 65 77 52 65 | 63 74 28 20 2f 2a 20 54 |stViewRe|ct( /* T|
|000019e0| 45 48 61 6e 64 6c 65 20 | 64 6f 63 54 45 20 2a 2f |EHandle |docTE */|
|000019f0| 20 29 3b 0d 09 76 6f 69 | 64 20 41 64 6a 75 73 74 | );..voi|d Adjust|
|00001a00| 54 45 28 20 2f 2a 20 57 | 69 6e 64 6f 77 50 74 72 |TE( /* W|indowPtr|
|00001a10| 20 77 69 6e 64 6f 77 20 | 2a 2f 20 29 3b 0d 09 76 | window |*/ );..v|
|00001a20| 6f 69 64 20 41 64 6a 75 | 73 74 48 56 28 20 2f 2a |oid Adju|stHV( /*|
|00001a30| 20 42 6f 6f 6c 65 61 6e | 20 69 73 56 65 72 74 2c | Boolean| isVert,|
|00001a40| 20 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 20 63 | Control|Handle c|
|00001a50| 6f 6e 74 72 6f 6c 2c 20 | 54 45 48 61 6e 64 6c 65 |ontrol, |TEHandle|
|00001a60| 20 64 6f 63 54 45 2c 0d | 09 09 09 09 09 42 6f 6f | docTE,.|.....Boo|
|00001a70| 6c 65 61 6e 20 63 61 6e | 52 65 64 72 61 77 20 2a |lean can|Redraw *|
|00001a80| 2f 20 29 3b 0d 09 76 6f | 69 64 20 41 64 6a 75 73 |/ );..vo|id Adjus|
|00001a90| 74 53 63 72 6f 6c 6c 56 | 61 6c 75 65 73 28 20 2f |tScrollV|alues( /|
|00001aa0| 2a 20 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |* Window|Ptr wind|
|00001ab0| 6f 77 2c 20 42 6f 6f 6c | 65 61 6e 20 63 61 6e 52 |ow, Bool|ean canR|
|00001ac0| 65 64 72 61 77 20 2a 2f | 20 29 3b 0d 09 76 6f 69 |edraw */| );..voi|
|00001ad0| 64 20 41 64 6a 75 73 74 | 53 63 72 6f 6c 6c 53 69 |d Adjust|ScrollSi|
|00001ae0| 7a 65 73 28 20 2f 2a 20 | 57 69 6e 64 6f 77 50 74 |zes( /* |WindowPt|
|00001af0| 72 20 77 69 6e 64 6f 77 | 20 2a 2f 20 29 3b 0d 09 |r window| */ );..|
|00001b00| 76 6f 69 64 20 41 64 6a | 75 73 74 53 63 72 6f 6c |void Adj|ustScrol|
|00001b10| 6c 62 61 72 73 28 20 2f | 2a 20 57 69 6e 64 6f 77 |lbars( /|* Window|
|00001b20| 50 74 72 20 77 69 6e 64 | 6f 77 2c 20 42 6f 6f 6c |Ptr wind|ow, Bool|
|00001b30| 65 61 6e 20 6e 65 65 64 | 73 52 65 73 69 7a 65 20 |ean need|sResize |
|00001b40| 2a 2f 20 29 3b 0d 09 70 | 61 73 63 61 6c 20 76 6f |*/ );..p|ascal vo|
|00001b50| 69 64 20 50 61 73 63 61 | 6c 43 6c 69 6b 4c 6f 6f |id Pasca|lClikLoo|
|00001b60| 70 28 29 3b 0d 09 70 61 | 73 63 61 6c 20 50 72 6f |p();..pa|scal Pro|
|00001b70| 63 50 74 72 20 47 65 74 | 4f 6c 64 43 6c 69 6b 4c |cPtr Get|OldClikL|
|00001b80| 6f 6f 70 28 29 3b 0d 09 | 42 6f 6f 6c 65 61 6e 20 |oop();..|Boolean |
|00001b90| 49 73 41 70 70 57 69 6e | 64 6f 77 28 20 2f 2a 20 |IsAppWin|dow( /* |
|00001ba0| 57 69 6e 64 6f 77 50 74 | 72 20 77 69 6e 64 6f 77 |WindowPt|r window|
|00001bb0| 20 2a 2f 20 29 3b 0d 09 | 42 6f 6f 6c 65 61 6e 20 | */ );..|Boolean |
|00001bc0| 49 73 44 41 57 69 6e 64 | 6f 77 28 20 2f 2a 20 57 |IsDAWind|ow( /* W|
|00001bd0| 69 6e 64 6f 77 50 74 72 | 20 77 69 6e 64 6f 77 20 |indowPtr| window |
|00001be0| 2a 2f 20 29 3b 0d 09 42 | 6f 6f 6c 65 61 6e 20 54 |*/ );..B|oolean T|
|00001bf0| 72 61 70 41 76 61 69 6c | 61 62 6c 65 28 20 2f 2a |rapAvail|able( /*|
|00001c00| 20 73 68 6f 72 74 20 74 | 4e 75 6d 62 65 72 2c 20 | short t|Number, |
|00001c10| 54 72 61 70 54 79 70 65 | 20 74 54 79 70 65 20 2a |TrapType| tType *|
|00001c20| 2f 20 29 3b 0d 23 65 6c | 73 65 0d 09 76 6f 69 64 |/ );.#el|se..void|
|00001c30| 20 45 76 65 6e 74 4c 6f | 6f 70 28 20 76 6f 69 64 | EventLo|op( void|
|00001c40| 20 29 3b 0d 09 76 6f 69 | 64 20 44 6f 45 76 65 6e | );..voi|d DoEven|
|00001c50| 74 28 20 45 76 65 6e 74 | 52 65 63 6f 72 64 20 2a |t( Event|Record *|
|00001c60| 65 76 65 6e 74 20 29 3b | 0d 09 76 6f 69 64 20 41 |event );|..void A|
|00001c70| 64 6a 75 73 74 43 75 72 | 73 6f 72 28 20 50 6f 69 |djustCur|sor( Poi|
|00001c80| 6e 74 20 6d 6f 75 73 65 | 2c 20 52 67 6e 48 61 6e |nt mouse|, RgnHan|
|00001c90| 64 6c 65 20 72 65 67 69 | 6f 6e 20 29 3b 0d 09 76 |dle regi|on );..v|
|00001ca0| 6f 69 64 20 44 6f 47 72 | 6f 77 57 69 6e 64 6f 77 |oid DoGr|owWindow|
|00001cb0| 28 20 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |( Window|Ptr wind|
|00001cc0| 6f 77 2c 20 45 76 65 6e | 74 52 65 63 6f 72 64 20 |ow, Even|tRecord |
|00001cd0| 2a 65 76 65 6e 74 20 29 | 3b 0d 09 76 6f 69 64 20 |*event )|;..void |
|00001ce0| 44 6f 5a 6f 6f 6d 57 69 | 6e 64 6f 77 28 20 57 69 |DoZoomWi|ndow( Wi|
|00001cf0| 6e 64 6f 77 50 74 72 20 | 77 69 6e 64 6f 77 2c 20 |ndowPtr |window, |
|00001d00| 73 68 6f 72 74 20 70 61 | 72 74 20 29 3b 0d 09 76 |short pa|rt );..v|
|00001d10| 6f 69 64 20 52 65 73 69 | 7a 65 57 69 6e 64 6f 77 |oid Resi|zeWindow|
|00001d20| 28 20 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |( Window|Ptr wind|
|00001d30| 6f 77 20 29 3b 0d 09 76 | 6f 69 64 20 47 65 74 4c |ow );..v|oid GetL|
|00001d40| 6f 63 61 6c 55 70 64 61 | 74 65 52 67 6e 28 20 57 |ocalUpda|teRgn( W|
|00001d50| 69 6e 64 6f 77 50 74 72 | 20 77 69 6e 64 6f 77 2c |indowPtr| window,|
|00001d60| 20 52 67 6e 48 61 6e 64 | 6c 65 20 6c 6f 63 61 6c | RgnHand|le local|
|00001d70| 52 67 6e 20 29 3b 0d 09 | 76 6f 69 64 20 44 6f 55 |Rgn );..|void DoU|
|00001d80| 70 64 61 74 65 28 20 57 | 69 6e 64 6f 77 50 74 72 |pdate( W|indowPtr|
|00001d90| 20 77 69 6e 64 6f 77 20 | 29 3b 0d 09 76 6f 69 64 | window |);..void|
|00001da0| 20 44 6f 44 65 61 63 74 | 69 76 61 74 65 28 20 57 | DoDeact|ivate( W|
|00001db0| 69 6e 64 6f 77 50 74 72 | 20 77 69 6e 64 6f 77 20 |indowPtr| window |
|00001dc0| 29 3b 0d 09 76 6f 69 64 | 20 44 6f 41 63 74 69 76 |);..void| DoActiv|
|00001dd0| 61 74 65 28 20 57 69 6e | 64 6f 77 50 74 72 20 77 |ate( Win|dowPtr w|
|00001de0| 69 6e 64 6f 77 2c 20 42 | 6f 6f 6c 65 61 6e 20 62 |indow, B|oolean b|
|00001df0| 65 63 6f 6d 69 6e 67 41 | 63 74 69 76 65 20 29 3b |ecomingA|ctive );|
|00001e00| 0d 09 76 6f 69 64 20 44 | 6f 43 6f 6e 74 65 6e 74 |..void D|oContent|
|00001e10| 43 6c 69 63 6b 28 20 57 | 69 6e 64 6f 77 50 74 72 |Click( W|indowPtr|
|00001e20| 20 77 69 6e 64 6f 77 2c | 20 45 76 65 6e 74 52 65 | window,| EventRe|
|00001e30| 63 6f 72 64 20 2a 65 76 | 65 6e 74 20 29 3b 0d 09 |cord *ev|ent );..|
|00001e40| 76 6f 69 64 20 44 6f 4b | 65 79 44 6f 77 6e 28 20 |void DoK|eyDown( |
|00001e50| 45 76 65 6e 74 52 65 63 | 6f 72 64 20 2a 65 76 65 |EventRec|ord *eve|
|00001e60| 6e 74 20 29 3b 0d 09 75 | 6e 73 69 67 6e 65 64 20 |nt );..u|nsigned |
|00001e70| 6c 6f 6e 67 20 47 65 74 | 53 6c 65 65 70 28 20 76 |long Get|Sleep( v|
|00001e80| 6f 69 64 20 29 3b 0d 09 | 76 6f 69 64 20 43 6f 6d |oid );..|void Com|
|00001e90| 6d 6f 6e 41 63 74 69 6f | 6e 28 20 43 6f 6e 74 72 |monActio|n( Contr|
|00001ea0| 6f 6c 48 61 6e 64 6c 65 | 20 63 6f 6e 74 72 6f 6c |olHandle| control|
|00001eb0| 2c 20 73 68 6f 72 74 20 | 2a 61 6d 6f 75 6e 74 20 |, short |*amount |
|00001ec0| 29 3b 0d 09 70 61 73 63 | 61 6c 20 76 6f 69 64 20 |);..pasc|al void |
|00001ed0| 56 41 63 74 69 6f 6e 50 | 72 6f 63 28 20 43 6f 6e |VActionP|roc( Con|
|00001ee0| 74 72 6f 6c 48 61 6e 64 | 6c 65 20 63 6f 6e 74 72 |trolHand|le contr|
|00001ef0| 6f 6c 2c 20 73 68 6f 72 | 74 20 70 61 72 74 20 29 |ol, shor|t part )|
|00001f00| 3b 0d 09 70 61 73 63 61 | 6c 20 76 6f 69 64 20 48 |;..pasca|l void H|
|00001f10| 41 63 74 69 6f 6e 50 72 | 6f 63 28 20 43 6f 6e 74 |ActionPr|oc( Cont|
|00001f20| 72 6f 6c 48 61 6e 64 6c | 65 20 63 6f 6e 74 72 6f |rolHandl|e contro|
|00001f30| 6c 2c 20 73 68 6f 72 74 | 20 70 61 72 74 20 29 3b |l, short| part );|
|00001f40| 0d 09 76 6f 69 64 20 44 | 6f 49 64 6c 65 28 20 76 |..void D|oIdle( v|
|00001f50| 6f 69 64 20 29 3b 0d 09 | 76 6f 69 64 20 44 72 61 |oid );..|void Dra|
|00001f60| 77 57 69 6e 64 6f 77 28 | 20 57 69 6e 64 6f 77 50 |wWindow(| WindowP|
|00001f70| 74 72 20 77 69 6e 64 6f | 77 20 29 3b 0d 09 76 6f |tr windo|w );..vo|
|00001f80| 69 64 20 41 64 6a 75 73 | 74 4d 65 6e 75 73 28 20 |id Adjus|tMenus( |
|00001f90| 76 6f 69 64 20 29 3b 0d | 09 76 6f 69 64 20 44 6f |void );.|.void Do|
|00001fa0| 4d 65 6e 75 43 6f 6d 6d | 61 6e 64 28 20 6c 6f 6e |MenuComm|and( lon|
|00001fb0| 67 20 6d 65 6e 75 52 65 | 73 75 6c 74 20 29 3b 0d |g menuRe|sult );.|
|00001fc0| 09 76 6f 69 64 20 44 6f | 4e 65 77 28 20 76 6f 69 |.void Do|New( voi|
|00001fd0| 64 20 29 3b 0d 09 76 6f | 69 64 20 44 6f 43 6c 6f |d );..vo|id DoClo|
|00001fe0| 73 65 57 69 6e 64 6f 77 | 28 20 57 69 6e 64 6f 77 |seWindow|( Window|
|00001ff0| 50 74 72 20 77 69 6e 64 | 6f 77 20 29 3b 0d 09 76 |Ptr wind|ow );..v|
|00002000| 6f 69 64 20 44 6f 43 6c | 6f 73 65 42 65 68 69 6e |oid DoCl|oseBehin|
|00002010| 64 28 20 57 69 6e 64 6f | 77 50 74 72 20 77 69 6e |d( Windo|wPtr win|
|00002020| 64 6f 77 20 29 3b 0d 09 | 76 6f 69 64 20 54 65 72 |dow );..|void Ter|
|00002030| 6d 69 6e 61 74 65 28 20 | 76 6f 69 64 20 29 3b 0d |minate( |void );.|
|00002040| 09 76 6f 69 64 20 49 6e | 69 74 69 61 6c 69 7a 65 |.void In|itialize|
|00002050| 28 20 76 6f 69 64 20 29 | 3b 0d 09 76 6f 69 64 20 |( void )|;..void |
|00002060| 46 6f 72 63 65 45 6e 76 | 69 72 6f 6e 73 28 20 76 |ForceEnv|irons( v|
|00002070| 6f 69 64 20 29 3b 0d 09 | 76 6f 69 64 20 47 65 74 |oid );..|void Get|
|00002080| 54 45 52 65 63 74 28 20 | 57 69 6e 64 6f 77 50 74 |TERect( |WindowPt|
|00002090| 72 20 77 69 6e 64 6f 77 | 2c 20 52 65 63 74 20 2a |r window|, Rect *|
|000020a0| 74 65 52 65 63 74 20 29 | 3b 0d 09 76 6f 69 64 20 |teRect )|;..void |
|000020b0| 41 64 6a 75 73 74 56 69 | 65 77 52 65 63 74 28 20 |AdjustVi|ewRect( |
|000020c0| 54 45 48 61 6e 64 6c 65 | 20 64 6f 63 54 45 20 29 |TEHandle| docTE )|
|000020d0| 3b 0d 09 76 6f 69 64 20 | 41 64 6a 75 73 74 54 45 |;..void |AdjustTE|
|000020e0| 28 20 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |( Window|Ptr wind|
|000020f0| 6f 77 20 29 3b 0d 09 76 | 6f 69 64 20 41 64 6a 75 |ow );..v|oid Adju|
|00002100| 73 74 48 56 28 20 42 6f | 6f 6c 65 61 6e 20 69 73 |stHV( Bo|olean is|
|00002110| 56 65 72 74 2c 20 43 6f | 6e 74 72 6f 6c 48 61 6e |Vert, Co|ntrolHan|
|00002120| 64 6c 65 20 63 6f 6e 74 | 72 6f 6c 2c 20 54 45 48 |dle cont|rol, TEH|
|00002130| 61 6e 64 6c 65 20 64 6f | 63 54 45 2c 0d 09 09 09 |andle do|cTE,....|
|00002140| 09 09 42 6f 6f 6c 65 61 | 6e 20 63 61 6e 52 65 64 |..Boolea|n canRed|
|00002150| 72 61 77 20 29 3b 0d 09 | 76 6f 69 64 20 41 64 6a |raw );..|void Adj|
|00002160| 75 73 74 53 63 72 6f 6c | 6c 56 61 6c 75 65 73 28 |ustScrol|lValues(|
|00002170| 20 57 69 6e 64 6f 77 50 | 74 72 20 77 69 6e 64 6f | WindowP|tr windo|
|00002180| 77 2c 20 42 6f 6f 6c 65 | 61 6e 20 63 61 6e 52 65 |w, Boole|an canRe|
|00002190| 64 72 61 77 20 29 3b 0d | 09 76 6f 69 64 20 41 64 |draw );.|.void Ad|
|000021a0| 6a 75 73 74 53 63 72 6f | 6c 6c 53 69 7a 65 73 28 |justScro|llSizes(|
|000021b0| 20 57 69 6e 64 6f 77 50 | 74 72 20 77 69 6e 64 6f | WindowP|tr windo|
|000021c0| 77 20 29 3b 0d 09 76 6f | 69 64 20 41 64 6a 75 73 |w );..vo|id Adjus|
|000021d0| 74 53 63 72 6f 6c 6c 62 | 61 72 73 28 20 57 69 6e |tScrollb|ars( Win|
|000021e0| 64 6f 77 50 74 72 20 77 | 69 6e 64 6f 77 2c 20 42 |dowPtr w|indow, B|
|000021f0| 6f 6f 6c 65 61 6e 20 6e | 65 65 64 73 52 65 73 69 |oolean n|eedsResi|
|00002200| 7a 65 20 29 3b 0d 09 70 | 61 73 63 61 6c 20 76 6f |ze );..p|ascal vo|
|00002210| 69 64 20 50 61 73 63 61 | 6c 43 6c 69 6b 4c 6f 6f |id Pasca|lClikLoo|
|00002220| 70 28 29 3b 0d 09 70 61 | 73 63 61 6c 20 50 72 6f |p();..pa|scal Pro|
|00002230| 63 50 74 72 20 47 65 74 | 4f 6c 64 43 6c 69 6b 4c |cPtr Get|OldClikL|
|00002240| 6f 6f 70 28 29 3b 0d 09 | 42 6f 6f 6c 65 61 6e 20 |oop();..|Boolean |
|00002250| 49 73 41 70 70 57 69 6e | 64 6f 77 28 20 57 69 6e |IsAppWin|dow( Win|
|00002260| 64 6f 77 50 74 72 20 77 | 69 6e 64 6f 77 20 29 3b |dowPtr w|indow );|
|00002270| 0d 09 42 6f 6f 6c 65 61 | 6e 20 49 73 44 41 57 69 |..Boolea|n IsDAWi|
|00002280| 6e 64 6f 77 28 20 57 69 | 6e 64 6f 77 50 74 72 20 |ndow( Wi|ndowPtr |
|00002290| 77 69 6e 64 6f 77 20 29 | 3b 0d 09 42 6f 6f 6c 65 |window )|;..Boole|
|000022a0| 61 6e 20 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |an TrapA|vailable|
|000022b0| 28 20 73 68 6f 72 74 20 | 74 4e 75 6d 62 65 72 2c |( short |tNumber,|
|000022c0| 20 54 72 61 70 54 79 70 | 65 20 74 54 79 70 65 20 | TrapTyp|e tType |
|000022d0| 29 3b 0d 23 65 6e 64 69 | 66 0d 0d 0d 2f 2a 20 4d |);.#endi|f.../* M|
|000022e0| 61 6b 65 20 74 68 65 20 | 32 2e 30 20 49 6e 74 65 |ake the |2.0 Inte|
|000022f0| 72 66 61 63 65 20 66 6f | 72 20 70 61 73 73 69 6e |rface fo|r passin|
|00002300| 67 20 50 6f 69 6e 74 73 | 20 74 6f 20 74 68 65 20 |g Points| to the |
|00002310| 54 6f 6f 6c 62 6f 78 20 | 62 79 20 61 64 64 72 65 |Toolbox |by addre|
|00002320| 73 73 2c 0d 20 20 20 65 | 6d 75 6c 61 74 65 20 74 |ss,. e|mulate t|
|00002330| 68 65 20 33 2e 30 20 6d | 65 74 68 6f 64 20 6f 66 |he 3.0 m|ethod of|
|00002340| 20 70 61 73 73 69 6e 67 | 20 50 6f 69 6e 74 73 20 | passing| Points |
|00002350| 62 79 20 76 61 6c 75 65 | 2e 20 54 68 69 73 20 6c |by value|. This l|
|00002360| 69 73 74 20 6f 6e 6c 79 | 20 63 6f 6e 74 61 69 6e |ist only| contain|
|00002370| 73 0d 20 20 20 74 68 65 | 20 61 66 66 65 63 74 65 |s. the| affecte|
|00002380| 64 20 72 6f 75 74 69 6e | 65 73 20 61 63 74 75 61 |d routin|es actua|
|00002390| 6c 6c 79 20 75 73 65 64 | 20 69 6e 20 74 68 69 73 |lly used| in this|
|000023a0| 20 73 61 6d 70 6c 65 2c | 20 61 6e 64 20 69 73 20 | sample,| and is |
|000023b0| 6e 6f 74 20 69 6e 74 65 | 6e 64 65 64 20 74 6f 0d |not inte|nded to.|
|000023c0| 20 20 20 62 65 20 61 20 | 63 6f 6d 70 72 65 68 65 | be a |comprehe|
|000023d0| 6e 73 69 76 65 20 6c 69 | 73 74 20 6f 66 20 74 68 |nsive li|st of th|
|000023e0| 65 20 61 66 66 65 63 74 | 65 64 20 72 6f 75 74 69 |e affect|ed routi|
|000023f0| 6e 65 73 2e 0d 0d 20 20 | 20 46 6f 72 20 72 6f 75 |nes... | For rou|
|00002400| 74 69 6e 65 73 20 74 68 | 61 74 20 68 61 76 65 20 |tines th|at have |
|00002410| 53 74 72 32 35 35 20 66 | 6f 72 6d 61 6c 20 70 61 |Str255 f|ormal pa|
|00002420| 72 61 6d 65 74 65 72 73 | 20 77 65 20 63 61 6e 6e |rameters| we cann|
|00002430| 6f 74 20 64 6f 20 61 20 | 73 69 6d 69 6c 61 72 20 |ot do a |similar |
|00002440| 74 72 69 63 6b 0d 20 20 | 20 73 6f 20 74 68 65 20 |trick. | so the |
|00002450| 6e 65 63 65 73 73 61 72 | 79 20 63 68 61 6e 67 65 |necessar|y change|
|00002460| 73 20 61 72 65 20 69 6e | 20 74 68 65 20 63 6f 64 |s are in| the cod|
|00002470| 65 20 69 74 73 65 6c 66 | 2e 20 53 65 61 72 63 68 |e itself|. Search|
|00002480| 69 6e 67 20 66 6f 72 20 | 4d 50 57 33 20 77 69 6c |ing for |MPW3 wil|
|00002490| 6c 20 66 69 6e 64 0d 20 | 20 20 74 68 65 6d 2e 20 |l find. | them. |
|000024a0| 2a 2f 0d 23 69 66 6e 64 | 65 66 20 4d 50 57 33 0d |*/.#ifnd|ef MPW3.|
|000024b0| 23 09 64 65 66 69 6e 65 | 20 46 69 6e 64 57 69 6e |#.define| FindWin|
|000024c0| 64 6f 77 09 46 49 4e 44 | 57 49 4e 44 4f 57 0d 23 |dow.FIND|WINDOW.#|
|000024d0| 09 64 65 66 69 6e 65 20 | 4d 65 6e 75 53 65 6c 65 |.define |MenuSele|
|000024e0| 63 74 09 4d 45 4e 55 53 | 45 4c 45 43 54 0d 23 09 |ct.MENUS|ELECT.#.|
|000024f0| 64 65 66 69 6e 65 20 44 | 72 61 67 57 69 6e 64 6f |define D|ragWindo|
|00002500| 77 09 44 52 41 47 57 49 | 4e 44 4f 57 0d 23 09 64 |w.DRAGWI|NDOW.#.d|
|00002510| 65 66 69 6e 65 20 54 72 | 61 63 6b 47 6f 41 77 61 |efine Tr|ackGoAwa|
|00002520| 79 09 54 52 41 43 4b 47 | 4f 41 57 41 59 0d 23 09 |y.TRACKG|OAWAY.#.|
|00002530| 64 65 66 69 6e 65 20 50 | 74 49 6e 52 67 6e 09 09 |define P|tInRgn..|
|00002540| 50 54 49 4e 52 47 4e 0d | 23 09 64 65 66 69 6e 65 |PTINRGN.|#.define|
|00002550| 20 54 45 43 6c 69 63 6b | 09 09 54 45 43 4c 49 43 | TEClick|..TECLIC|
|00002560| 4b 0d 23 09 64 65 66 69 | 6e 65 20 46 69 6e 64 43 |K.#.defi|ne FindC|
|00002570| 6f 6e 74 72 6f 6c 09 46 | 49 4e 44 43 4f 4e 54 52 |ontrol.F|INDCONTR|
|00002580| 4f 4c 0d 23 09 64 65 66 | 69 6e 65 20 54 72 61 63 |OL.#.def|ine Trac|
|00002590| 6b 43 6f 6e 74 72 6f 6c | 09 54 52 41 43 4b 43 4f |kControl|.TRACKCO|
|000025a0| 4e 54 52 4f 4c 0d 23 09 | 64 65 66 69 6e 65 20 47 |NTROL.#.|define G|
|000025b0| 72 6f 77 57 69 6e 64 6f | 77 09 47 52 4f 57 57 49 |rowWindo|w.GROWWI|
|000025c0| 4e 44 4f 57 0d 23 09 64 | 65 66 69 6e 65 20 54 72 |NDOW.#.d|efine Tr|
|000025d0| 61 63 6b 42 6f 78 09 09 | 54 52 41 43 4b 42 4f 58 |ackBox..|TRACKBOX|
|000025e0| 0d 70 61 73 63 61 6c 20 | 76 6f 69 64 20 44 65 62 |.pascal |void Deb|
|000025f0| 75 67 67 65 72 28 29 0d | 20 20 20 20 65 78 74 65 |ugger().| exte|
|00002600| 72 6e 20 30 78 41 39 46 | 46 3b 0d 23 65 6e 64 69 |rn 0xA9F|F;.#endi|
|00002610| 66 0d 0d 2f 2a 20 44 65 | 66 69 6e 65 20 48 69 57 |f../* De|fine HiW|
|00002620| 72 64 20 61 6e 64 20 4c | 6f 57 72 64 20 6d 61 63 |rd and L|oWrd mac|
|00002630| 72 6f 73 20 66 6f 72 20 | 65 66 66 69 63 69 65 6e |ros for |efficien|
|00002640| 63 79 2e 20 2a 2f 0d 23 | 64 65 66 69 6e 65 20 48 |cy. */.#|define H|
|00002650| 69 57 72 64 28 61 4c 6f | 6e 67 29 09 28 28 28 61 |iWrd(aLo|ng).(((a|
|00002660| 4c 6f 6e 67 29 20 3e 3e | 20 31 36 29 20 26 20 30 |Long) >>| 16) & 0|
|00002670| 78 46 46 46 46 29 0d 23 | 64 65 66 69 6e 65 20 4c |xFFFF).#|define L|
|00002680| 6f 57 72 64 28 61 4c 6f | 6e 67 29 09 28 28 61 4c |oWrd(aLo|ng).((aL|
|00002690| 6f 6e 67 29 20 26 20 30 | 78 46 46 46 46 29 0d 0d |ong) & 0|xFFFF)..|
|000026a0| 2f 2a 20 44 65 66 69 6e | 65 20 54 6f 70 4c 65 66 |/* Defin|e TopLef|
|000026b0| 74 20 61 6e 64 20 42 6f | 74 52 69 67 68 74 20 6d |t and Bo|tRight m|
|000026c0| 61 63 72 6f 73 20 66 6f | 72 20 63 6f 6e 76 65 6e |acros fo|r conven|
|000026d0| 69 65 6e 63 65 2e 20 4e | 6f 74 69 63 65 20 74 68 |ience. N|otice th|
|000026e0| 65 20 69 6d 70 6c 69 63 | 69 74 0d 20 20 20 64 65 |e implic|it. de|
|000026f0| 70 65 6e 64 65 6e 63 79 | 20 6f 6e 20 74 68 65 20 |pendency| on the |
|00002700| 6f 72 64 65 72 69 6e 67 | 20 6f 66 20 66 69 65 6c |ordering| of fiel|
|00002710| 64 73 20 77 69 74 68 69 | 6e 20 61 20 52 65 63 74 |ds withi|n a Rect|
|00002720| 20 2a 2f 0d 23 64 65 66 | 69 6e 65 20 54 6f 70 4c | */.#def|ine TopL|
|00002730| 65 66 74 28 61 52 65 63 | 74 29 09 28 2a 20 28 50 |eft(aRec|t).(* (P|
|00002740| 6f 69 6e 74 20 2a 29 20 | 26 28 61 52 65 63 74 29 |oint *) |&(aRect)|
|00002750| 2e 74 6f 70 29 0d 23 64 | 65 66 69 6e 65 20 42 6f |.top).#d|efine Bo|
|00002760| 74 52 69 67 68 74 28 61 | 52 65 63 74 29 09 28 2a |tRight(a|Rect).(*|
|00002770| 20 28 50 6f 69 6e 74 20 | 2a 29 20 26 28 61 52 65 | (Point |*) &(aRe|
|00002780| 63 74 29 2e 62 6f 74 74 | 6f 6d 29 0d 0d 0d 2f 2a |ct).bott|om).../*|
|00002790| 20 54 68 69 73 20 72 6f | 75 74 69 6e 65 20 69 73 | This ro|utine is|
|000027a0| 20 70 61 72 74 20 6f 66 | 20 74 68 65 20 4d 50 57 | part of| the MPW|
|000027b0| 20 72 75 6e 74 69 6d 65 | 20 6c 69 62 72 61 72 79 | runtime| library|
|000027c0| 2e 20 54 68 69 73 20 65 | 78 74 65 72 6e 61 6c 0d |. This e|xternal.|
|000027d0| 20 20 20 72 65 66 65 72 | 65 6e 63 65 20 74 6f 20 | refer|ence to |
|000027e0| 69 74 20 69 73 20 64 6f | 6e 65 20 73 6f 20 74 68 |it is do|ne so th|
|000027f0| 61 74 20 77 65 20 63 61 | 6e 20 75 6e 6c 6f 61 64 |at we ca|n unload|
|00002800| 20 69 74 73 20 73 65 67 | 6d 65 6e 74 2c 20 25 41 | its seg|ment, %A|
|00002810| 35 49 6e 69 74 2e 20 2a | 2f 0d 0d 65 78 74 65 72 |5Init. *|/..exter|
|00002820| 6e 20 76 6f 69 64 20 5f | 44 61 74 61 49 6e 69 74 |n void _|DataInit|
|00002830| 28 29 3b 0d 0d 0d 2f 2a | 20 41 20 72 65 66 65 72 |();.../*| A refer|
|00002840| 65 6e 63 65 20 74 6f 20 | 6f 75 72 20 61 73 73 65 |ence to |our asse|
|00002850| 6d 62 6c 79 20 6c 61 6e | 67 75 61 67 65 20 72 6f |mbly lan|guage ro|
|00002860| 75 74 69 6e 65 20 74 68 | 61 74 20 67 65 74 73 20 |utine th|at gets |
|00002870| 61 74 74 61 63 68 65 64 | 20 74 6f 20 74 68 65 20 |attached| to the |
|00002880| 63 6c 69 6b 4c 6f 6f 70 | 0d 66 69 65 6c 64 20 6f |clikLoop|.field o|
|00002890| 66 20 6f 75 72 20 54 45 | 20 72 65 63 6f 72 64 2e |f our TE| record.|
|000028a0| 20 2a 2f 0d 0d 65 78 74 | 65 72 6e 20 70 61 73 63 | */..ext|ern pasc|
|000028b0| 61 6c 20 76 6f 69 64 20 | 41 73 6d 43 6c 69 6b 4c |al void |AsmClikL|
|000028c0| 6f 6f 70 28 29 3b 0d 0d | 0d 23 64 65 66 69 6e 65 |oop();..|.#define|
|000028d0| 20 5f 5f 53 45 47 5f 5f | 20 4d 61 69 6e 0d 6d 61 | __SEG__| Main.ma|
|000028e0| 69 6e 28 29 0d 7b 0d 09 | 55 6e 6c 6f 61 64 53 65 |in().{..|UnloadSe|
|000028f0| 67 28 28 50 74 72 29 20 | 5f 44 61 74 61 49 6e 69 |g((Ptr) |_DataIni|
|00002900| 74 29 3b 09 09 2f 2a 20 | 6e 6f 74 65 20 74 68 61 |t);../* |note tha|
|00002910| 74 20 5f 44 61 74 61 49 | 6e 69 74 20 6d 75 73 74 |t _DataI|nit must|
|00002920| 20 6e 6f 74 20 62 65 20 | 69 6e 20 4d 61 69 6e 21 | not be |in Main!|
|00002930| 20 2a 2f 0d 09 46 6f 72 | 63 65 45 6e 76 69 72 6f | */..For|ceEnviro|
|00002940| 6e 73 28 29 3b 09 09 09 | 09 2f 2a 20 63 68 65 63 |ns();...|./* chec|
|00002950| 6b 20 66 6f 72 20 73 6f | 6d 65 20 62 61 73 69 63 |k for so|me basic|
|00002960| 20 72 65 71 75 69 72 65 | 6d 65 6e 74 73 3b 20 65 | require|ments; e|
|00002970| 78 69 74 73 20 69 66 20 | 6e 6f 74 20 6d 65 74 20 |xits if |not met |
|00002980| 2a 2f 0d 09 4d 61 78 41 | 70 70 6c 5a 6f 6e 65 28 |*/..MaxA|pplZone(|
|00002990| 29 3b 09 09 09 09 09 2f | 2a 20 65 78 70 61 6e 64 |);...../|* expand|
|000029a0| 20 74 68 65 20 68 65 61 | 70 20 73 6f 20 63 6f 64 | the hea|p so cod|
|000029b0| 65 20 73 65 67 6d 65 6e | 74 73 20 6c 6f 61 64 20 |e segmen|ts load |
|000029c0| 61 74 20 74 68 65 20 74 | 6f 70 20 2a 2f 0d 0d 09 |at the t|op */...|
|000029d0| 49 6e 69 74 69 61 6c 69 | 7a 65 28 29 3b 09 09 09 |Initiali|ze();...|
|000029e0| 09 09 2f 2a 20 69 6e 69 | 74 69 61 6c 69 7a 65 20 |../* ini|tialize |
|000029f0| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 2a 2f 0d 09 |the prog|ram */..|
|00002a00| 55 6e 6c 6f 61 64 53 65 | 67 28 28 50 74 72 29 20 |UnloadSe|g((Ptr) |
|00002a10| 49 6e 69 74 69 61 6c 69 | 7a 65 29 3b 09 2f 2a 20 |Initiali|ze);./* |
|00002a20| 6e 6f 74 65 20 74 68 61 | 74 20 49 6e 69 74 69 61 |note tha|t Initia|
|00002a30| 6c 69 7a 65 20 6d 75 73 | 74 20 6e 6f 74 20 62 65 |lize mus|t not be|
|00002a40| 20 69 6e 20 4d 61 69 6e | 21 20 2a 2f 0d 0d 09 45 | in Main|! */...E|
|00002a50| 76 65 6e 74 4c 6f 6f 70 | 28 29 3b 09 09 09 09 09 |ventLoop|();.....|
|00002a60| 2f 2a 20 63 61 6c 6c 20 | 74 68 65 20 6d 61 69 6e |/* call |the main|
|00002a70| 20 65 76 65 6e 74 20 6c | 6f 6f 70 20 2a 2f 0d 7d | event l|oop */.}|
|00002a80| 0d 0d 0d 2f 2a 20 47 65 | 74 20 65 76 65 6e 74 73 |.../* Ge|t events|
|00002a90| 20 66 6f 72 65 76 65 72 | 2c 20 61 6e 64 20 68 61 | forever|, and ha|
|00002aa0| 6e 64 6c 65 20 74 68 65 | 6d 20 62 79 20 63 61 6c |ndle the|m by cal|
|00002ab0| 6c 69 6e 67 20 44 6f 45 | 76 65 6e 74 2e 0d 20 20 |ling DoE|vent.. |
|00002ac0| 20 41 6c 73 6f 20 63 61 | 6c 6c 20 41 64 6a 75 73 | Also ca|ll Adjus|
|00002ad0| 74 43 75 72 73 6f 72 20 | 65 61 63 68 20 74 69 6d |tCursor |each tim|
|00002ae0| 65 20 74 68 72 6f 75 67 | 68 20 74 68 65 20 6c 6f |e throug|h the lo|
|00002af0| 6f 70 2e 20 2a 2f 0d 0d | 23 64 65 66 69 6e 65 20 |op. */..|#define |
|00002b00| 5f 5f 53 45 47 5f 5f 20 | 4d 61 69 6e 0d 76 6f 69 |__SEG__ |Main.voi|
|00002b10| 64 20 45 76 65 6e 74 4c | 6f 6f 70 28 29 0d 7b 0d |d EventL|oop().{.|
|00002b20| 09 52 67 6e 48 61 6e 64 | 6c 65 09 63 75 72 73 6f |.RgnHand|le.curso|
|00002b30| 72 52 67 6e 3b 0d 09 42 | 6f 6f 6c 65 61 6e 09 09 |rRgn;..B|oolean..|
|00002b40| 67 6f 74 45 76 65 6e 74 | 3b 0d 09 45 76 65 6e 74 |gotEvent|;..Event|
|00002b50| 52 65 63 6f 72 64 09 65 | 76 65 6e 74 3b 0d 0d 09 |Record.e|vent;...|
|00002b60| 63 75 72 73 6f 72 52 67 | 6e 20 3d 20 4e 65 77 52 |cursorRg|n = NewR|
|00002b70| 67 6e 28 29 3b 09 09 09 | 2f 2a 20 77 65 d5 6c 6c |gn();...|/* we.ll|
|00002b80| 20 70 61 73 73 20 57 4e | 45 20 61 6e 20 65 6d 70 | pass WN|E an emp|
|00002b90| 74 79 20 72 65 67 69 6f | 6e 20 74 68 65 20 31 73 |ty regio|n the 1s|
|00002ba0| 74 20 74 69 6d 65 20 74 | 68 72 75 20 2a 2f 0d 09 |t time t|hru */..|
|00002bb0| 64 6f 20 7b 0d 09 09 2f | 2a 20 75 73 65 20 57 4e |do {.../|* use WN|
|00002bc0| 45 20 69 66 20 69 74 20 | 69 73 20 61 76 61 69 6c |E if it |is avail|
|00002bd0| 61 62 6c 65 20 2a 2f 0d | 09 09 69 66 20 28 20 67 |able */.|..if ( g|
|00002be0| 48 61 73 57 61 69 74 4e | 65 78 74 45 76 65 6e 74 |HasWaitN|extEvent|
|00002bf0| 20 29 0d 09 09 09 67 6f | 74 45 76 65 6e 74 20 3d | )....go|tEvent =|
|00002c00| 20 57 61 69 74 4e 65 78 | 74 45 76 65 6e 74 28 65 | WaitNex|tEvent(e|
|00002c10| 76 65 72 79 45 76 65 6e | 74 2c 20 26 65 76 65 6e |veryEven|t, &even|
|00002c20| 74 2c 20 47 65 74 53 6c | 65 65 70 28 29 2c 20 63 |t, GetSl|eep(), c|
|00002c30| 75 72 73 6f 72 52 67 6e | 29 3b 0d 09 09 65 6c 73 |ursorRgn|);...els|
|00002c40| 65 20 7b 0d 09 09 09 53 | 79 73 74 65 6d 54 61 73 |e {....S|ystemTas|
|00002c50| 6b 28 29 3b 0d 09 09 09 | 67 6f 74 45 76 65 6e 74 |k();....|gotEvent|
|00002c60| 20 3d 20 47 65 74 4e 65 | 78 74 45 76 65 6e 74 28 | = GetNe|xtEvent(|
|00002c70| 65 76 65 72 79 45 76 65 | 6e 74 2c 20 26 65 76 65 |everyEve|nt, &eve|
|00002c80| 6e 74 29 3b 0d 09 09 7d | 0d 09 09 69 66 20 28 20 |nt);...}|...if ( |
|00002c90| 67 6f 74 45 76 65 6e 74 | 20 29 20 7b 0d 09 09 09 |gotEvent| ) {....|
|00002ca0| 2f 2a 20 6d 61 6b 65 20 | 73 75 72 65 20 77 65 20 |/* make |sure we |
|00002cb0| 68 61 76 65 20 74 68 65 | 20 72 69 67 68 74 20 63 |have the| right c|
|00002cc0| 75 72 73 6f 72 20 62 65 | 66 6f 72 65 20 68 61 6e |ursor be|fore han|
|00002cd0| 64 6c 69 6e 67 20 74 68 | 65 20 65 76 65 6e 74 20 |dling th|e event |
|00002ce0| 2a 2f 0d 09 09 09 41 64 | 6a 75 73 74 43 75 72 73 |*/....Ad|justCurs|
|00002cf0| 6f 72 28 65 76 65 6e 74 | 2e 77 68 65 72 65 2c 20 |or(event|.where, |
|00002d00| 63 75 72 73 6f 72 52 67 | 6e 29 3b 0d 09 09 09 44 |cursorRg|n);....D|
|00002d10| 6f 45 76 65 6e 74 28 26 | 65 76 65 6e 74 29 3b 0d |oEvent(&|event);.|
|00002d20| 09 09 7d 0d 09 09 65 6c | 73 65 0d 09 09 09 44 6f |..}...el|se....Do|
|00002d30| 49 64 6c 65 28 29 3b 09 | 09 09 09 2f 2a 20 70 65 |Idle();.|.../* pe|
|00002d40| 72 66 6f 72 6d 20 69 64 | 6c 65 20 74 61 73 6b 73 |rform id|le tasks|
|00002d50| 20 77 68 65 6e 20 69 74 | d5 73 20 6e 6f 74 20 6f | when it|.s not o|
|00002d60| 75 72 20 65 76 65 6e 74 | 20 2a 2f 0d 09 09 2f 2a |ur event| */.../*|
|00002d70| 20 63 68 61 6e 67 65 20 | 74 68 65 20 63 75 72 73 | change |the curs|
|00002d80| 6f 72 20 28 61 6e 64 20 | 72 65 67 69 6f 6e 29 20 |or (and |region) |
|00002d90| 69 66 20 6e 65 63 65 73 | 73 61 72 79 20 2a 2f 0d |if neces|sary */.|
|00002da0| 09 09 41 64 6a 75 73 74 | 43 75 72 73 6f 72 28 65 |..Adjust|Cursor(e|
|00002db0| 76 65 6e 74 2e 77 68 65 | 72 65 2c 20 63 75 72 73 |vent.whe|re, curs|
|00002dc0| 6f 72 52 67 6e 29 3b 0d | 09 7d 20 77 68 69 6c 65 |orRgn);.|.} while|
|00002dd0| 20 28 20 74 72 75 65 20 | 29 3b 09 2f 2a 20 6c 6f | ( true |);./* lo|
|00002de0| 6f 70 20 66 6f 72 65 76 | 65 72 3b 20 77 65 20 71 |op forev|er; we q|
|00002df0| 75 69 74 20 76 69 61 20 | 45 78 69 74 54 6f 53 68 |uit via |ExitToSh|
|00002e00| 65 6c 6c 20 2a 2f 0d 7d | 20 2f 2a 45 76 65 6e 74 |ell */.}| /*Event|
|00002e10| 4c 6f 6f 70 2a 2f 0d 0d | 0d 2f 2a 20 44 6f 20 74 |Loop*/..|./* Do t|
|00002e20| 68 65 20 72 69 67 68 74 | 20 74 68 69 6e 67 20 66 |he right| thing f|
|00002e30| 6f 72 20 61 6e 20 65 76 | 65 6e 74 2e 20 44 65 74 |or an ev|ent. Det|
|00002e40| 65 72 6d 69 6e 65 20 77 | 68 61 74 20 6b 69 6e 64 |ermine w|hat kind|
|00002e50| 20 6f 66 20 65 76 65 6e | 74 20 69 74 20 69 73 2c | of even|t it is,|
|00002e60| 20 61 6e 64 20 63 61 6c | 6c 0d 20 74 68 65 20 61 | and cal|l. the a|
|00002e70| 70 70 72 6f 70 72 69 61 | 74 65 20 72 6f 75 74 69 |ppropria|te routi|
|00002e80| 6e 65 73 2e 20 2a 2f 0d | 0d 23 64 65 66 69 6e 65 |nes. */.|.#define|
|00002e90| 20 5f 5f 53 45 47 5f 5f | 20 4d 61 69 6e 0d 76 6f | __SEG__| Main.vo|
|00002ea0| 69 64 20 44 6f 45 76 65 | 6e 74 28 65 76 65 6e 74 |id DoEve|nt(event|
|00002eb0| 29 0d 09 45 76 65 6e 74 | 52 65 63 6f 72 64 09 2a |)..Event|Record.*|
|00002ec0| 65 76 65 6e 74 3b 0d 7b | 0d 09 73 68 6f 72 74 09 |event;.{|..short.|
|00002ed0| 09 70 61 72 74 3b 0d 09 | 57 69 6e 64 6f 77 50 74 |.part;..|WindowPt|
|00002ee0| 72 09 77 69 6e 64 6f 77 | 3b 0d 09 63 68 61 72 09 |r.window|;..char.|
|00002ef0| 09 6b 65 79 3b 0d 0d 09 | 73 77 69 74 63 68 20 28 |.key;...|switch (|
|00002f00| 20 65 76 65 6e 74 2d 3e | 77 68 61 74 20 29 20 7b | event->|what ) {|
|00002f10| 0d 09 09 63 61 73 65 20 | 6e 75 6c 6c 45 76 65 6e |...case |nullEven|
|00002f20| 74 3a 0d 09 09 09 2f 2a | 20 77 65 20 69 64 6c 65 |t:..../*| we idle|
|00002f30| 20 66 6f 72 20 6e 75 6c | 6c 2f 6d 6f 75 73 65 20 | for nul|l/mouse |
|00002f40| 6d 6f 76 65 64 20 65 76 | 65 6e 74 73 20 61 6e 64 |moved ev|ents and|
|00002f50| 73 20 66 6f 72 20 65 76 | 65 6e 74 73 20 77 68 69 |s for ev|ents whi|
|00002f60| 63 68 20 61 72 65 6e d5 | 74 0d 09 09 09 09 6f 75 |ch aren.|t.....ou|
|00002f70| 72 73 20 28 73 65 65 20 | 45 76 65 6e 74 4c 6f 6f |rs (see |EventLoo|
|00002f80| 70 29 20 2a 2f 0d 09 09 | 09 44 6f 49 64 6c 65 28 |p) */...|.DoIdle(|
|00002f90| 29 3b 0d 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 63 |);....br|eak;...c|
|00002fa0| 61 73 65 20 6d 6f 75 73 | 65 44 6f 77 6e 3a 0d 09 |ase mous|eDown:..|
|00002fb0| 09 09 70 61 72 74 20 3d | 20 46 69 6e 64 57 69 6e |..part =| FindWin|
|00002fc0| 64 6f 77 28 65 76 65 6e | 74 2d 3e 77 68 65 72 65 |dow(even|t->where|
|00002fd0| 2c 20 26 77 69 6e 64 6f | 77 29 3b 0d 09 09 09 73 |, &windo|w);....s|
|00002fe0| 77 69 74 63 68 20 28 20 | 70 61 72 74 20 29 20 7b |witch ( |part ) {|
|00002ff0| 0d 09 09 09 09 63 61 73 | 65 20 69 6e 4d 65 6e 75 |.....cas|e inMenu|
|00003000| 42 61 72 3a 20 20 20 20 | 20 20 20 20 20 20 20 20 |Bar: | |
|00003010| 20 2f 2a 20 70 72 6f 63 | 65 73 73 20 61 20 6d 6f | /* proc|ess a mo|
|00003020| 75 73 65 20 6d 65 6e 75 | 20 63 6f 6d 6d 61 6e 64 |use menu| command|
|00003030| 20 28 69 66 20 61 6e 79 | 29 20 2a 2f 0d 09 09 09 | (if any|) */....|
|00003040| 09 09 41 64 6a 75 73 74 | 4d 65 6e 75 73 28 29 3b |..Adjust|Menus();|
|00003050| 09 2f 2a 20 62 72 69 6e | 67 20 d5 65 6d 20 75 70 |./* brin|g .em up|
|00003060| 2d 74 6f 2d 64 61 74 65 | 20 2a 2f 0d 09 09 09 09 |-to-date| */.....|
|00003070| 09 44 6f 4d 65 6e 75 43 | 6f 6d 6d 61 6e 64 28 4d |.DoMenuC|ommand(M|
|00003080| 65 6e 75 53 65 6c 65 63 | 74 28 65 76 65 6e 74 2d |enuSelec|t(event-|
|00003090| 3e 77 68 65 72 65 29 29 | 3b 0d 09 09 09 09 09 62 |>where))|;......b|
|000030a0| 72 65 61 6b 3b 0d 09 09 | 09 09 63 61 73 65 20 69 |reak;...|..case i|
|000030b0| 6e 53 79 73 57 69 6e 64 | 6f 77 3a 20 20 20 20 20 |nSysWind|ow: |
|000030c0| 20 20 20 20 20 20 2f 2a | 20 6c 65 74 20 74 68 65 | /*| let the|
|000030d0| 20 73 79 73 74 65 6d 20 | 68 61 6e 64 6c 65 20 74 | system |handle t|
|000030e0| 68 65 20 6d 6f 75 73 65 | 44 6f 77 6e 20 2a 2f 0d |he mouse|Down */.|
|000030f0| 09 09 09 09 09 53 79 73 | 74 65 6d 43 6c 69 63 6b |.....Sys|temClick|
|00003100| 28 65 76 65 6e 74 2c 20 | 77 69 6e 64 6f 77 29 3b |(event, |window);|
|00003110| 0d 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|00003120| 09 63 61 73 65 20 69 6e | 43 6f 6e 74 65 6e 74 3a |.case in|Content:|
|00003130| 0d 09 09 09 09 09 69 66 | 20 28 20 77 69 6e 64 6f |......if| ( windo|
|00003140| 77 20 21 3d 20 46 72 6f | 6e 74 57 69 6e 64 6f 77 |w != Fro|ntWindow|
|00003150| 28 29 20 29 20 7b 0d 09 | 09 09 09 09 09 53 65 6c |() ) {..|.....Sel|
|00003160| 65 63 74 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |ectWindo|w(window|
|00003170| 29 3b 0d 09 09 09 09 09 | 09 2f 2a 44 6f 45 76 65 |);......|./*DoEve|
|00003180| 6e 74 28 65 76 65 6e 74 | 29 3b 2a 2f 09 2f 2a 20 |nt(event|);*/./* |
|00003190| 75 73 65 20 74 68 69 73 | 20 6c 69 6e 65 20 66 6f |use this| line fo|
|000031a0| 72 20 22 64 6f 20 66 69 | 72 73 74 20 63 6c 69 63 |r "do fi|rst clic|
|000031b0| 6b 22 20 2a 2f 0d 09 09 | 09 09 09 7d 20 65 6c 73 |k" */...|...} els|
|000031c0| 65 0d 09 09 09 09 09 09 | 44 6f 43 6f 6e 74 65 6e |e.......|DoConten|
|000031d0| 74 43 6c 69 63 6b 28 77 | 69 6e 64 6f 77 2c 20 65 |tClick(w|indow, e|
|000031e0| 76 65 6e 74 29 3b 0d 09 | 09 09 09 09 62 72 65 61 |vent);..|....brea|
|000031f0| 6b 3b 0d 09 09 09 09 63 | 61 73 65 20 69 6e 44 72 |k;.....c|ase inDr|
|00003200| 61 67 3a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ag: | |
|00003210| 20 20 20 2f 2a 20 70 61 | 73 73 20 73 63 72 65 65 | /* pa|ss scree|
|00003220| 6e 42 69 74 73 2e 62 6f | 75 6e 64 73 20 74 6f 20 |nBits.bo|unds to |
|00003230| 67 65 74 20 61 6c 6c 20 | 67 44 65 76 69 63 65 73 |get all |gDevices|
|00003240| 20 2a 2f 0d 09 09 09 09 | 09 44 72 61 67 57 69 6e | */.....|.DragWin|
|00003250| 64 6f 77 28 77 69 6e 64 | 6f 77 2c 20 65 76 65 6e |dow(wind|ow, even|
|00003260| 74 2d 3e 77 68 65 72 65 | 2c 20 26 71 64 2e 73 63 |t->where|, &qd.sc|
|00003270| 72 65 65 6e 42 69 74 73 | 2e 62 6f 75 6e 64 73 29 |reenBits|.bounds)|
|00003280| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |;......b|reak;...|
|00003290| 09 09 63 61 73 65 20 69 | 6e 47 6f 41 77 61 79 3a |..case i|nGoAway:|
|000032a0| 0d 09 09 09 09 09 69 66 | 20 28 20 54 72 61 63 6b |......if| ( Track|
|000032b0| 47 6f 41 77 61 79 28 77 | 69 6e 64 6f 77 2c 20 65 |GoAway(w|indow, e|
|000032c0| 76 65 6e 74 2d 3e 77 68 | 65 72 65 29 20 29 0d 09 |vent->wh|ere) )..|
|000032d0| 09 09 09 09 09 44 6f 43 | 6c 6f 73 65 57 69 6e 64 |.....DoC|loseWind|
|000032e0| 6f 77 28 77 69 6e 64 6f | 77 29 3b 0d 09 09 09 09 |ow(windo|w);.....|
|000032f0| 09 62 72 65 61 6b 3b 0d | 09 09 09 09 63 61 73 65 |.break;.|....case|
|00003300| 20 69 6e 47 72 6f 77 3a | 0d 09 09 09 09 09 44 6f | inGrow:|......Do|
|00003310| 47 72 6f 77 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |GrowWind|ow(windo|
|00003320| 77 2c 20 65 76 65 6e 74 | 29 3b 0d 09 09 09 09 09 |w, event|);......|
|00003330| 62 72 65 61 6b 3b 0d 09 | 09 09 09 63 61 73 65 20 |break;..|...case |
|00003340| 69 6e 5a 6f 6f 6d 49 6e | 3a 0d 09 09 09 09 63 61 |inZoomIn|:.....ca|
|00003350| 73 65 20 69 6e 5a 6f 6f | 6d 4f 75 74 3a 0d 09 09 |se inZoo|mOut:...|
|00003360| 09 09 69 66 20 28 20 54 | 72 61 63 6b 42 6f 78 28 |..if ( T|rackBox(|
|00003370| 77 69 6e 64 6f 77 2c 20 | 65 76 65 6e 74 2d 3e 77 |window, |event->w|
|00003380| 68 65 72 65 2c 20 70 61 | 72 74 29 20 29 0d 09 09 |here, pa|rt) )...|
|00003390| 09 09 09 09 44 6f 5a 6f | 6f 6d 57 69 6e 64 6f 77 |....DoZo|omWindow|
|000033a0| 28 77 69 6e 64 6f 77 2c | 20 70 61 72 74 29 3b 0d |(window,| part);.|
|000033b0| 09 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 7d |.....bre|ak;....}|
|000033c0| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 63 61 73 |....brea|k;...cas|
|000033d0| 65 20 6b 65 79 44 6f 77 | 6e 3a 0d 09 09 63 61 73 |e keyDow|n:...cas|
|000033e0| 65 20 61 75 74 6f 4b 65 | 79 3a 20 20 20 20 20 20 |e autoKe|y: |
|000033f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003400| 20 2f 2a 20 63 68 65 63 | 6b 20 66 6f 72 20 6d 65 | /* chec|k for me|
|00003410| 6e 75 6b 65 79 20 65 71 | 75 69 76 61 6c 65 6e 74 |nukey eq|uivalent|
|00003420| 73 20 2a 2f 0d 09 09 09 | 6b 65 79 20 3d 20 65 76 |s */....|key = ev|
|00003430| 65 6e 74 2d 3e 6d 65 73 | 73 61 67 65 20 26 20 63 |ent->mes|sage & c|
|00003440| 68 61 72 43 6f 64 65 4d | 61 73 6b 3b 0d 09 09 09 |harCodeM|ask;....|
|00003450| 69 66 20 28 20 65 76 65 | 6e 74 2d 3e 6d 6f 64 69 |if ( eve|nt->modi|
|00003460| 66 69 65 72 73 20 26 20 | 63 6d 64 4b 65 79 20 29 |fiers & |cmdKey )|
|00003470| 20 7b 09 2f 2a 20 43 6f | 6d 6d 61 6e 64 20 6b 65 | {./* Co|mmand ke|
|00003480| 79 20 64 6f 77 6e 20 2a | 2f 0d 09 09 09 09 69 66 |y down *|/.....if|
|00003490| 20 28 20 65 76 65 6e 74 | 2d 3e 77 68 61 74 20 3d | ( event|->what =|
|000034a0| 3d 20 6b 65 79 44 6f 77 | 6e 20 29 20 7b 0d 09 09 |= keyDow|n ) {...|
|000034b0| 09 09 09 41 64 6a 75 73 | 74 4d 65 6e 75 73 28 29 |...Adjus|tMenus()|
|000034c0| 3b 09 09 09 2f 2a 20 65 | 6e 61 62 6c 65 2f 64 69 |;.../* e|nable/di|
|000034d0| 73 61 62 6c 65 2f 63 68 | 65 63 6b 20 6d 65 6e 75 |sable/ch|eck menu|
|000034e0| 20 69 74 65 6d 73 20 70 | 72 6f 70 65 72 6c 79 20 | items p|roperly |
|000034f0| 2a 2f 0d 09 09 09 09 09 | 44 6f 4d 65 6e 75 43 6f |*/......|DoMenuCo|
|00003500| 6d 6d 61 6e 64 28 4d 65 | 6e 75 4b 65 79 28 6b 65 |mmand(Me|nuKey(ke|
|00003510| 79 29 29 3b 0d 09 09 09 | 09 7d 0d 09 09 09 7d 20 |y));....|.}....} |
|00003520| 65 6c 73 65 0d 09 09 09 | 09 44 6f 4b 65 79 44 6f |else....|.DoKeyDo|
|00003530| 77 6e 28 65 76 65 6e 74 | 29 3b 0d 09 09 09 62 72 |wn(event|);....br|
|00003540| 65 61 6b 3b 0d 09 09 63 | 61 73 65 20 61 63 74 69 |eak;...c|ase acti|
|00003550| 76 61 74 65 45 76 74 3a | 0d 09 09 09 44 6f 41 63 |vateEvt:|....DoAc|
|00003560| 74 69 76 61 74 65 28 28 | 57 69 6e 64 6f 77 50 74 |tivate((|WindowPt|
|00003570| 72 29 20 65 76 65 6e 74 | 2d 3e 6d 65 73 73 61 67 |r) event|->messag|
|00003580| 65 2c 20 28 65 76 65 6e | 74 2d 3e 6d 6f 64 69 66 |e, (even|t->modif|
|00003590| 69 65 72 73 20 26 20 61 | 63 74 69 76 65 46 6c 61 |iers & a|ctiveFla|
|000035a0| 67 29 20 21 3d 20 30 29 | 3b 0d 09 09 09 62 72 65 |g) != 0)|;....bre|
|000035b0| 61 6b 3b 0d 09 09 63 61 | 73 65 20 75 70 64 61 74 |ak;...ca|se updat|
|000035c0| 65 45 76 74 3a 0d 09 09 | 09 44 6f 55 70 64 61 74 |eEvt:...|.DoUpdat|
|000035d0| 65 28 28 57 69 6e 64 6f | 77 50 74 72 29 20 65 76 |e((Windo|wPtr) ev|
|000035e0| 65 6e 74 2d 3e 6d 65 73 | 73 61 67 65 29 3b 0d 09 |ent->mes|sage);..|
|000035f0| 09 09 62 72 65 61 6b 3b | 0d 09 09 63 61 73 65 20 |..break;|...case |
|00003600| 6f 73 45 76 65 6e 74 3a | 0d 09 09 09 73 77 69 74 |osEvent:|....swit|
|00003610| 63 68 20 28 65 76 65 6e | 74 2d 3e 6d 65 73 73 61 |ch (even|t->messa|
|00003620| 67 65 20 3e 3e 20 32 34 | 29 20 7b 20 09 2f 2a 20 |ge >> 24|) { ./* |
|00003630| 68 69 67 68 20 62 79 74 | 65 20 6f 66 20 6d 65 73 |high byt|e of mes|
|00003640| 73 61 67 65 20 2a 2f 0d | 09 09 09 09 63 61 73 65 |sage */.|....case|
|00003650| 20 6d 6f 75 73 65 4d 6f | 76 65 64 4d 65 73 73 61 | mouseMo|vedMessa|
|00003660| 67 65 3a 0d 09 09 09 09 | 09 44 6f 49 64 6c 65 28 |ge:.....|.DoIdle(|
|00003670| 29 3b 09 09 09 09 09 2f | 2a 20 6d 6f 75 73 65 2d |);...../|* mouse-|
|00003680| 6d 6f 76 65 64 20 69 73 | 20 61 6c 73 6f 20 61 6e |moved is| also an|
|00003690| 20 69 64 6c 65 20 65 76 | 65 6e 74 20 2a 2f 0d 09 | idle ev|ent */..|
|000036a0| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 09 63 |....brea|k;.....c|
|000036b0| 61 73 65 20 73 75 73 70 | 65 6e 64 52 65 73 75 6d |ase susp|endResum|
|000036c0| 65 4d 65 73 73 61 67 65 | 3a 09 09 2f 2a 20 73 75 |eMessage|:../* su|
|000036d0| 73 70 65 6e 64 2f 72 65 | 73 75 6d 65 20 69 73 20 |spend/re|sume is |
|000036e0| 61 6c 73 6f 20 61 6e 20 | 61 63 74 69 76 61 74 65 |also an |activate|
|000036f0| 2f 64 65 61 63 74 69 76 | 61 74 65 20 2a 2f 0d 09 |/deactiv|ate */..|
|00003700| 09 09 09 09 67 49 6e 42 | 61 63 6b 67 72 6f 75 6e |....gInB|ackgroun|
|00003710| 64 20 3d 20 28 65 76 65 | 6e 74 2d 3e 6d 65 73 73 |d = (eve|nt->mess|
|00003720| 61 67 65 20 26 20 72 65 | 73 75 6d 65 4d 61 73 6b |age & re|sumeMask|
|00003730| 29 20 3d 3d 20 30 3b 0d | 09 09 09 09 09 44 6f 41 |) == 0;.|.....DoA|
|00003740| 63 74 69 76 61 74 65 28 | 46 72 6f 6e 74 57 69 6e |ctivate(|FrontWin|
|00003750| 64 6f 77 28 29 2c 20 21 | 67 49 6e 42 61 63 6b 67 |dow(), !|gInBackg|
|00003760| 72 6f 75 6e 64 29 3b 0d | 09 09 09 09 09 62 72 65 |round);.|.....bre|
|00003770| 61 6b 3b 0d 09 09 09 7d | 0d 09 09 09 62 72 65 61 |ak;....}|....brea|
|00003780| 6b 3b 0d 09 7d 0d 7d 20 | 2f 2a 44 6f 45 76 65 6e |k;..}.} |/*DoEven|
|00003790| 74 2a 2f 0d 0d 0d 2f 2a | 09 43 68 61 6e 67 65 20 |t*/.../*|.Change |
|000037a0| 74 68 65 20 63 75 72 73 | 6f 72 27 73 20 73 68 61 |the curs|or's sha|
|000037b0| 70 65 2c 20 64 65 70 65 | 6e 64 69 6e 67 20 6f 6e |pe, depe|nding on|
|000037c0| 20 69 74 73 20 70 6f 73 | 69 74 69 6f 6e 2e 20 54 | its pos|ition. T|
|000037d0| 68 69 73 20 61 6c 73 6f | 20 63 61 6c 63 75 6c 61 |his also| calcula|
|000037e0| 74 65 73 20 74 68 65 20 | 72 65 67 69 6f 6e 0d 09 |tes the |region..|
|000037f0| 77 68 65 72 65 20 74 68 | 65 20 63 75 72 72 65 6e |where th|e curren|
|00003800| 74 20 63 75 72 73 6f 72 | 20 72 65 73 69 64 65 73 |t cursor| resides|
|00003810| 20 28 66 6f 72 20 57 61 | 69 74 4e 65 78 74 45 76 | (for Wa|itNextEv|
|00003820| 65 6e 74 29 2e 20 57 68 | 65 6e 20 74 68 65 20 6d |ent). Wh|en the m|
|00003830| 6f 75 73 65 20 6d 6f 76 | 65 73 20 6f 75 74 73 69 |ouse mov|es outsi|
|00003840| 64 65 20 6f 66 0d 09 74 | 68 69 73 20 72 65 67 69 |de of..t|his regi|
|00003850| 6f 6e 2c 20 61 6e 20 65 | 76 65 6e 74 20 69 73 20 |on, an e|vent is |
|00003860| 67 65 6e 65 72 61 74 65 | 64 2e 20 49 66 20 74 68 |generate|d. If th|
|00003870| 65 72 65 20 69 73 20 6d | 6f 72 65 20 74 6f 20 74 |ere is m|ore to t|
|00003880| 68 65 20 65 76 65 6e 74 | 20 74 68 61 6e 20 6a 75 |he event| than ju|
|00003890| 73 74 0d 09 d2 74 68 65 | 20 6d 6f 75 73 65 20 6d |st...the| mouse m|
|000038a0| 6f 76 65 64 d3 2c 20 77 | 65 20 67 65 74 20 63 61 |oved., w|e get ca|
|000038b0| 6c 6c 65 64 20 62 65 66 | 6f 72 65 20 74 68 65 20 |lled bef|ore the |
|000038c0| 65 76 65 6e 74 20 69 73 | 20 70 72 6f 63 65 73 73 |event is| process|
|000038d0| 65 64 20 74 6f 20 6d 61 | 6b 65 20 73 75 72 65 0d |ed to ma|ke sure.|
|000038e0| 09 74 68 65 20 63 75 72 | 73 6f 72 20 69 73 20 74 |.the cur|sor is t|
|000038f0| 68 65 20 72 69 67 68 74 | 20 6f 6e 65 2e 20 49 6e |he right| one. In|
|00003900| 20 61 6e 79 20 28 61 68 | 65 6d 29 20 65 76 65 6e | any (ah|em) even|
|00003910| 74 2c 20 74 68 69 73 20 | 69 73 20 63 61 6c 6c 65 |t, this |is calle|
|00003920| 64 20 61 67 61 69 6e 20 | 62 65 66 6f 72 65 20 77 |d again |before w|
|00003930| 65 0d 09 66 61 6c 6c 20 | 62 61 63 6b 20 69 6e 74 |e..fall |back int|
|00003940| 6f 20 57 4e 45 2e 20 2a | 2f 0d 0d 23 64 65 66 69 |o WNE. *|/..#defi|
|00003950| 6e 65 20 5f 5f 53 45 47 | 5f 5f 20 4d 61 69 6e 0d |ne __SEG|__ Main.|
|00003960| 76 6f 69 64 20 41 64 6a | 75 73 74 43 75 72 73 6f |void Adj|ustCurso|
|00003970| 72 28 6d 6f 75 73 65 2c | 72 65 67 69 6f 6e 29 0d |r(mouse,|region).|
|00003980| 09 50 6f 69 6e 74 09 09 | 6d 6f 75 73 65 3b 0d 09 |.Point..|mouse;..|
|00003990| 52 67 6e 48 61 6e 64 6c | 65 09 72 65 67 69 6f 6e |RgnHandl|e.region|
|000039a0| 3b 0d 7b 0d 09 57 69 6e | 64 6f 77 50 74 72 09 77 |;.{..Win|dowPtr.w|
|000039b0| 69 6e 64 6f 77 3b 0d 09 | 52 67 6e 48 61 6e 64 6c |indow;..|RgnHandl|
|000039c0| 65 09 61 72 72 6f 77 52 | 67 6e 3b 0d 09 52 67 6e |e.arrowR|gn;..Rgn|
|000039d0| 48 61 6e 64 6c 65 09 69 | 42 65 61 6d 52 67 6e 3b |Handle.i|BeamRgn;|
|000039e0| 0d 09 52 65 63 74 09 09 | 69 42 65 61 6d 52 65 63 |..Rect..|iBeamRec|
|000039f0| 74 3b 0d 0d 09 77 69 6e | 64 6f 77 20 3d 20 46 72 |t;...win|dow = Fr|
|00003a00| 6f 6e 74 57 69 6e 64 6f | 77 28 29 3b 09 2f 2a 20 |ontWindo|w();./* |
|00003a10| 77 65 20 6f 6e 6c 79 20 | 61 64 6a 75 73 74 20 74 |we only |adjust t|
|00003a20| 68 65 20 63 75 72 73 6f | 72 20 77 68 65 6e 20 77 |he curso|r when w|
|00003a30| 65 20 61 72 65 20 69 6e | 20 66 72 6f 6e 74 20 2a |e are in| front *|
|00003a40| 2f 0d 09 69 66 20 28 20 | 28 21 20 67 49 6e 42 61 |/..if ( |(! gInBa|
|00003a50| 63 6b 67 72 6f 75 6e 64 | 29 20 26 26 20 28 21 20 |ckground|) && (! |
|00003a60| 49 73 44 41 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |IsDAWind|ow(windo|
|00003a70| 77 29 29 20 29 20 7b 0d | 09 09 2f 2a 20 63 61 6c |w)) ) {.|../* cal|
|00003a80| 63 75 6c 61 74 65 20 72 | 65 67 69 6f 6e 73 20 66 |culate r|egions f|
|00003a90| 6f 72 20 64 69 66 66 65 | 72 65 6e 74 20 63 75 72 |or diffe|rent cur|
|00003aa0| 73 6f 72 20 73 68 61 70 | 65 73 20 2a 2f 0d 09 09 |sor shap|es */...|
|00003ab0| 61 72 72 6f 77 52 67 6e | 20 3d 20 4e 65 77 52 67 |arrowRgn| = NewRg|
|00003ac0| 6e 28 29 3b 0d 09 09 69 | 42 65 61 6d 52 67 6e 20 |n();...i|BeamRgn |
|00003ad0| 3d 20 4e 65 77 52 67 6e | 28 29 3b 0d 0d 09 09 2f |= NewRgn|();..../|
|00003ae0| 2a 20 73 74 61 72 74 20 | 61 72 72 6f 77 52 67 6e |* start |arrowRgn|
|00003af0| 20 77 69 64 65 20 6f 70 | 65 6e 20 2a 2f 0d 09 09 | wide op|en */...|
|00003b00| 53 65 74 52 65 63 74 52 | 67 6e 28 61 72 72 6f 77 |SetRectR|gn(arrow|
|00003b10| 52 67 6e 2c 20 65 78 74 | 72 65 6d 65 4e 65 67 2c |Rgn, ext|remeNeg,|
|00003b20| 20 65 78 74 72 65 6d 65 | 4e 65 67 2c 20 65 78 74 | extreme|Neg, ext|
|00003b30| 72 65 6d 65 50 6f 73 2c | 20 65 78 74 72 65 6d 65 |remePos,| extreme|
|00003b40| 50 6f 73 29 3b 0d 0d 09 | 09 2f 2a 20 63 61 6c 63 |Pos);...|./* calc|
|00003b50| 75 6c 61 74 65 20 69 42 | 65 61 6d 52 67 6e 20 2a |ulate iB|eamRgn *|
|00003b60| 2f 0d 09 09 69 66 20 28 | 20 49 73 41 70 70 57 69 |/...if (| IsAppWi|
|00003b70| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 20 29 20 7b |ndow(win|dow) ) {|
|00003b80| 0d 09 09 09 69 42 65 61 | 6d 52 65 63 74 20 3d 20 |....iBea|mRect = |
|00003b90| 28 2a 28 28 44 6f 63 75 | 6d 65 6e 74 50 65 65 6b |(*((Docu|mentPeek|
|00003ba0| 29 20 77 69 6e 64 6f 77 | 29 2d 3e 64 6f 63 54 45 |) window|)->docTE|
|00003bb0| 29 2d 3e 76 69 65 77 52 | 65 63 74 3b 0d 09 09 09 |)->viewR|ect;....|
|00003bc0| 53 65 74 50 6f 72 74 28 | 77 69 6e 64 6f 77 29 3b |SetPort(|window);|
|00003bd0| 09 2f 2a 20 6d 61 6b 65 | 20 61 20 67 6c 6f 62 61 |./* make| a globa|
|00003be0| 6c 20 76 65 72 73 69 6f | 6e 20 6f 66 20 74 68 65 |l versio|n of the|
|00003bf0| 20 76 69 65 77 52 65 63 | 74 20 2a 2f 0d 09 09 09 | viewRec|t */....|
|00003c00| 4c 6f 63 61 6c 54 6f 47 | 6c 6f 62 61 6c 28 26 54 |LocalToG|lobal(&T|
|00003c10| 6f 70 4c 65 66 74 28 69 | 42 65 61 6d 52 65 63 74 |opLeft(i|BeamRect|
|00003c20| 29 29 3b 0d 09 09 09 4c | 6f 63 61 6c 54 6f 47 6c |));....L|ocalToGl|
|00003c30| 6f 62 61 6c 28 26 42 6f | 74 52 69 67 68 74 28 69 |obal(&Bo|tRight(i|
|00003c40| 42 65 61 6d 52 65 63 74 | 29 29 3b 0d 09 09 09 52 |BeamRect|));....R|
|00003c50| 65 63 74 52 67 6e 28 69 | 42 65 61 6d 52 67 6e 2c |ectRgn(i|BeamRgn,|
|00003c60| 20 26 69 42 65 61 6d 52 | 65 63 74 29 3b 0d 09 09 | &iBeamR|ect);...|
|00003c70| 09 2f 2a 20 77 65 20 74 | 65 6d 70 6f 72 61 72 69 |./* we t|emporari|
|00003c80| 6c 79 20 63 68 61 6e 67 | 65 20 74 68 65 20 70 6f |ly chang|e the po|
|00003c90| 72 74 d5 73 20 6f 72 69 | 67 69 6e 20 74 6f 20 d2 |rt.s ori|gin to .|
|00003ca0| 67 6c 6f 62 61 6c 66 79 | d3 20 74 68 65 20 76 69 |globalfy|. the vi|
|00003cb0| 73 52 67 6e 20 2a 2f 0d | 09 09 09 53 65 74 4f 72 |sRgn */.|...SetOr|
|00003cc0| 69 67 69 6e 28 2d 77 69 | 6e 64 6f 77 2d 3e 70 6f |igin(-wi|ndow->po|
|00003cd0| 72 74 42 69 74 73 2e 62 | 6f 75 6e 64 73 2e 6c 65 |rtBits.b|ounds.le|
|00003ce0| 66 74 2c 20 2d 77 69 6e | 64 6f 77 2d 3e 70 6f 72 |ft, -win|dow->por|
|00003cf0| 74 42 69 74 73 2e 62 6f | 75 6e 64 73 2e 74 6f 70 |tBits.bo|unds.top|
|00003d00| 29 3b 0d 09 09 09 53 65 | 63 74 52 67 6e 28 69 42 |);....Se|ctRgn(iB|
|00003d10| 65 61 6d 52 67 6e 2c 20 | 77 69 6e 64 6f 77 2d 3e |eamRgn, |window->|
|00003d20| 76 69 73 52 67 6e 2c 20 | 69 42 65 61 6d 52 67 6e |visRgn, |iBeamRgn|
|00003d30| 29 3b 0d 09 09 09 53 65 | 74 4f 72 69 67 69 6e 28 |);....Se|tOrigin(|
|00003d40| 30 2c 20 30 29 3b 0d 09 | 09 7d 0d 0d 09 09 2f 2a |0, 0);..|.}..../*|
|00003d50| 20 73 75 62 74 72 61 63 | 74 20 6f 74 68 65 72 20 | subtrac|t other |
|00003d60| 72 65 67 69 6f 6e 73 20 | 66 72 6f 6d 20 61 72 72 |regions |from arr|
|00003d70| 6f 77 52 67 6e 20 2a 2f | 0d 09 09 44 69 66 66 52 |owRgn */|...DiffR|
|00003d80| 67 6e 28 61 72 72 6f 77 | 52 67 6e 2c 20 69 42 65 |gn(arrow|Rgn, iBe|
|00003d90| 61 6d 52 67 6e 2c 20 61 | 72 72 6f 77 52 67 6e 29 |amRgn, a|rrowRgn)|
|00003da0| 3b 0d 0d 09 09 2f 2a 20 | 63 68 61 6e 67 65 20 74 |;..../* |change t|
|00003db0| 68 65 20 63 75 72 73 6f | 72 20 61 6e 64 20 74 68 |he curso|r and th|
|00003dc0| 65 20 72 65 67 69 6f 6e | 20 70 61 72 61 6d 65 74 |e region| paramet|
|00003dd0| 65 72 20 2a 2f 0d 09 09 | 69 66 20 28 20 50 74 49 |er */...|if ( PtI|
|00003de0| 6e 52 67 6e 28 6d 6f 75 | 73 65 2c 20 69 42 65 61 |nRgn(mou|se, iBea|
|00003df0| 6d 52 67 6e 29 20 29 20 | 7b 0d 09 09 09 53 65 74 |mRgn) ) |{....Set|
|00003e00| 43 75 72 73 6f 72 28 2a | 47 65 74 43 75 72 73 6f |Cursor(*|GetCurso|
|00003e10| 72 28 69 42 65 61 6d 43 | 75 72 73 6f 72 29 29 3b |r(iBeamC|ursor));|
|00003e20| 0d 09 09 09 43 6f 70 79 | 52 67 6e 28 69 42 65 61 |....Copy|Rgn(iBea|
|00003e30| 6d 52 67 6e 2c 20 72 65 | 67 69 6f 6e 29 3b 0d 09 |mRgn, re|gion);..|
|00003e40| 09 7d 20 65 6c 73 65 20 | 7b 0d 09 09 09 53 65 74 |.} else |{....Set|
|00003e50| 43 75 72 73 6f 72 28 26 | 71 64 2e 61 72 72 6f 77 |Cursor(&|qd.arrow|
|00003e60| 29 3b 0d 09 09 09 43 6f | 70 79 52 67 6e 28 61 72 |);....Co|pyRgn(ar|
|00003e70| 72 6f 77 52 67 6e 2c 20 | 72 65 67 69 6f 6e 29 3b |rowRgn, |region);|
|00003e80| 0d 09 09 7d 0d 0d 09 09 | 44 69 73 70 6f 73 65 52 |...}....|DisposeR|
|00003e90| 67 6e 28 61 72 72 6f 77 | 52 67 6e 29 3b 0d 09 09 |gn(arrow|Rgn);...|
|00003ea0| 44 69 73 70 6f 73 65 52 | 67 6e 28 69 42 65 61 6d |DisposeR|gn(iBeam|
|00003eb0| 52 67 6e 29 3b 0d 09 7d | 0d 7d 20 2f 2a 41 64 6a |Rgn);..}|.} /*Adj|
|00003ec0| 75 73 74 43 75 72 73 6f | 72 2a 2f 0d 0d 0d 2f 2a |ustCurso|r*/.../*|
|00003ed0| 09 43 61 6c 6c 65 64 20 | 77 68 65 6e 20 61 20 6d |.Called |when a m|
|00003ee0| 6f 75 73 65 44 6f 77 6e | 20 6f 63 63 75 72 73 20 |ouseDown| occurs |
|00003ef0| 69 6e 20 74 68 65 20 67 | 72 6f 77 20 62 6f 78 20 |in the g|row box |
|00003f00| 6f 66 20 61 6e 20 61 63 | 74 69 76 65 20 77 69 6e |of an ac|tive win|
|00003f10| 64 6f 77 2e 20 49 6e 0d | 09 6f 72 64 65 72 20 74 |dow. In.|.order t|
|00003f20| 6f 20 65 6c 69 6d 69 6e | 61 74 65 20 61 6e 79 20 |o elimin|ate any |
|00003f30| 27 66 6c 69 63 6b 65 72 | 27 2c 20 77 65 20 77 61 |'flicker|', we wa|
|00003f40| 6e 74 20 74 6f 20 69 6e | 76 61 6c 69 64 61 74 65 |nt to in|validate|
|00003f50| 20 6f 6e 6c 79 20 77 68 | 61 74 20 69 73 0d 09 6e | only wh|at is..n|
|00003f60| 65 63 65 73 73 61 72 79 | 2e 20 53 69 6e 63 65 20 |ecessary|. Since |
|00003f70| 52 65 73 69 7a 65 57 69 | 6e 64 6f 77 20 69 6e 76 |ResizeWi|ndow inv|
|00003f80| 61 6c 69 64 61 74 65 73 | 20 74 68 65 20 77 68 6f |alidates| the who|
|00003f90| 6c 65 20 70 6f 72 74 52 | 65 63 74 2c 20 77 65 20 |le portR|ect, we |
|00003fa0| 73 61 76 65 0d 09 74 68 | 65 20 6f 6c 64 20 54 45 |save..th|e old TE|
|00003fb0| 20 76 69 65 77 52 65 63 | 74 2c 20 69 6e 74 65 72 | viewRec|t, inter|
|00003fc0| 73 65 63 74 20 69 74 20 | 77 69 74 68 20 74 68 65 |sect it |with the|
|00003fd0| 20 6e 65 77 20 54 45 20 | 76 69 65 77 52 65 63 74 | new TE |viewRect|
|00003fe0| 2c 20 61 6e 64 0d 09 72 | 65 6d 6f 76 65 20 74 68 |, and..r|emove th|
|00003ff0| 65 20 72 65 73 75 6c 74 | 20 66 72 6f 6d 20 74 68 |e result| from th|
|00004000| 65 20 75 70 64 61 74 65 | 20 72 65 67 69 6f 6e 2e |e update| region.|
|00004010| 20 48 6f 77 65 76 65 72 | 2c 20 77 65 20 6d 75 73 | However|, we mus|
|00004020| 74 20 6d 61 6b 65 20 73 | 75 72 65 0d 09 74 68 61 |t make s|ure..tha|
|00004030| 74 20 61 6e 79 20 6f 6c | 64 20 75 70 64 61 74 65 |t any ol|d update|
|00004040| 20 72 65 67 69 6f 6e 20 | 74 68 61 74 20 6d 69 67 | region |that mig|
|00004050| 68 74 20 68 61 76 65 20 | 62 65 65 6e 20 61 72 6f |ht have |been aro|
|00004060| 75 6e 64 20 67 65 74 73 | 20 70 75 74 20 62 61 63 |und gets| put bac|
|00004070| 6b 2e 20 2a 2f 0d 0d 23 | 64 65 66 69 6e 65 20 5f |k. */..#|define _|
|00004080| 5f 53 45 47 5f 5f 20 4d | 61 69 6e 0d 76 6f 69 64 |_SEG__ M|ain.void|
|00004090| 20 44 6f 47 72 6f 77 57 | 69 6e 64 6f 77 28 77 69 | DoGrowW|indow(wi|
|000040a0| 6e 64 6f 77 2c 65 76 65 | 6e 74 29 0d 09 57 69 6e |ndow,eve|nt)..Win|
|000040b0| 64 6f 77 50 74 72 09 77 | 69 6e 64 6f 77 3b 0d 09 |dowPtr.w|indow;..|
|000040c0| 45 76 65 6e 74 52 65 63 | 6f 72 64 09 2a 65 76 65 |EventRec|ord.*eve|
|000040d0| 6e 74 3b 0d 7b 0d 09 6c | 6f 6e 67 09 09 67 72 6f |nt;.{..l|ong..gro|
|000040e0| 77 52 65 73 75 6c 74 3b | 0d 09 52 65 63 74 09 09 |wResult;|..Rect..|
|000040f0| 74 65 6d 70 52 65 63 74 | 3b 0d 09 52 67 6e 48 61 |tempRect|;..RgnHa|
|00004100| 6e 64 6c 65 09 74 65 6d | 70 52 67 6e 3b 0d 09 42 |ndle.tem|pRgn;..B|
|00004110| 6f 6f 6c 65 61 6e 09 09 | 69 67 6e 6f 72 65 52 65 |oolean..|ignoreRe|
|00004120| 73 75 6c 74 3b 0d 09 44 | 6f 63 75 6d 65 6e 74 50 |sult;..D|ocumentP|
|00004130| 65 65 6b 20 64 6f 63 3b | 0d 09 0d 09 74 65 6d 70 |eek doc;|....temp|
|00004140| 52 65 63 74 20 3d 20 71 | 64 2e 73 63 72 65 65 6e |Rect = q|d.screen|
|00004150| 42 69 74 73 2e 62 6f 75 | 6e 64 73 3b 09 09 09 09 |Bits.bou|nds;....|
|00004160| 09 2f 2a 20 73 65 74 20 | 75 70 20 6c 69 6d 69 74 |./* set |up limit|
|00004170| 69 6e 67 20 76 61 6c 75 | 65 73 20 2a 2f 0d 09 74 |ing valu|es */..t|
|00004180| 65 6d 70 52 65 63 74 2e | 6c 65 66 74 20 3d 20 6d |empRect.|left = m|
|00004190| 69 6e 44 6f 63 44 69 6d | 3b 0d 09 74 65 6d 70 52 |inDocDim|;..tempR|
|000041a0| 65 63 74 2e 74 6f 70 20 | 3d 20 6d 69 6e 44 6f 63 |ect.top |= minDoc|
|000041b0| 44 69 6d 3b 0d 09 67 72 | 6f 77 52 65 73 75 6c 74 |Dim;..gr|owResult|
|000041c0| 20 3d 20 47 72 6f 77 57 | 69 6e 64 6f 77 28 77 69 | = GrowW|indow(wi|
|000041d0| 6e 64 6f 77 2c 20 65 76 | 65 6e 74 2d 3e 77 68 65 |ndow, ev|ent->whe|
|000041e0| 72 65 2c 20 26 74 65 6d | 70 52 65 63 74 29 3b 0d |re, &tem|pRect);.|
|000041f0| 09 2f 2a 20 73 65 65 20 | 69 66 20 69 74 20 72 65 |./* see |if it re|
|00004200| 61 6c 6c 79 20 63 68 61 | 6e 67 65 64 20 73 69 7a |ally cha|nged siz|
|00004210| 65 20 2a 2f 0d 09 69 66 | 20 28 20 67 72 6f 77 52 |e */..if| ( growR|
|00004220| 65 73 75 6c 74 20 21 3d | 20 30 20 29 20 7b 0d 09 |esult !=| 0 ) {..|
|00004230| 09 64 6f 63 20 3d 20 28 | 44 6f 63 75 6d 65 6e 74 |.doc = (|Document|
|00004240| 50 65 65 6b 29 20 77 69 | 6e 64 6f 77 3b 0d 09 09 |Peek) wi|ndow;...|
|00004250| 74 65 6d 70 52 65 63 74 | 20 3d 20 28 2a 64 6f 63 |tempRect| = (*doc|
|00004260| 2d 3e 64 6f 63 54 45 29 | 2d 3e 76 69 65 77 52 65 |->docTE)|->viewRe|
|00004270| 63 74 3b 09 09 09 09 2f | 2a 20 73 61 76 65 20 6f |ct;..../|* save o|
|00004280| 6c 64 20 74 65 78 74 20 | 62 6f 78 20 2a 2f 0d 09 |ld text |box */..|
|00004290| 09 74 65 6d 70 52 67 6e | 20 3d 20 4e 65 77 52 67 |.tempRgn| = NewRg|
|000042a0| 6e 28 29 3b 0d 09 09 47 | 65 74 4c 6f 63 61 6c 55 |n();...G|etLocalU|
|000042b0| 70 64 61 74 65 52 67 6e | 28 77 69 6e 64 6f 77 2c |pdateRgn|(window,|
|000042c0| 20 74 65 6d 70 52 67 6e | 29 3b 09 09 09 09 2f 2a | tempRgn|);..../*|
|000042d0| 20 67 65 74 20 6c 6f 63 | 61 6c 69 7a 65 64 20 75 | get loc|alized u|
|000042e0| 70 64 61 74 65 20 72 65 | 67 69 6f 6e 20 2a 2f 0d |pdate re|gion */.|
|000042f0| 09 09 53 69 7a 65 57 69 | 6e 64 6f 77 28 77 69 6e |..SizeWi|ndow(win|
|00004300| 64 6f 77 2c 20 4c 6f 57 | 72 64 28 67 72 6f 77 52 |dow, LoW|rd(growR|
|00004310| 65 73 75 6c 74 29 2c 20 | 48 69 57 72 64 28 67 72 |esult), |HiWrd(gr|
|00004320| 6f 77 52 65 73 75 6c 74 | 29 2c 20 74 72 75 65 29 |owResult|), true)|
|00004330| 3b 0d 09 09 52 65 73 69 | 7a 65 57 69 6e 64 6f 77 |;...Resi|zeWindow|
|00004340| 28 77 69 6e 64 6f 77 29 | 3b 0d 09 09 2f 2a 20 63 |(window)|;.../* c|
|00004350| 61 6c 63 75 6c 61 74 65 | 20 26 20 76 61 6c 69 64 |alculate| & valid|
|00004360| 61 74 65 20 74 68 65 20 | 72 65 67 69 6f 6e 20 74 |ate the |region t|
|00004370| 68 61 74 20 68 61 73 6e | d5 74 20 63 68 61 6e 67 |hat hasn|.t chang|
|00004380| 65 64 20 73 6f 20 69 74 | 20 77 6f 6e d5 74 20 67 |ed so it| won.t g|
|00004390| 65 74 20 72 65 64 72 61 | 77 6e 20 2a 2f 0d 09 09 |et redra|wn */...|
|000043a0| 69 67 6e 6f 72 65 52 65 | 73 75 6c 74 20 3d 20 53 |ignoreRe|sult = S|
|000043b0| 65 63 74 52 65 63 74 28 | 26 74 65 6d 70 52 65 63 |ectRect(|&tempRec|
|000043c0| 74 2c 20 26 28 2a 64 6f | 63 2d 3e 64 6f 63 54 45 |t, &(*do|c->docTE|
|000043d0| 29 2d 3e 76 69 65 77 52 | 65 63 74 2c 20 26 74 65 |)->viewR|ect, &te|
|000043e0| 6d 70 52 65 63 74 29 3b | 0d 09 09 56 61 6c 69 64 |mpRect);|...Valid|
|000043f0| 52 65 63 74 28 26 74 65 | 6d 70 52 65 63 74 29 3b |Rect(&te|mpRect);|
|00004400| 09 09 09 09 09 09 09 2f | 2a 20 74 61 6b 65 20 69 |......./|* take i|
|00004410| 74 20 6f 75 74 20 6f 66 | 20 75 70 64 61 74 65 20 |t out of| update |
|00004420| 2a 2f 0d 09 09 49 6e 76 | 61 6c 52 67 6e 28 74 65 |*/...Inv|alRgn(te|
|00004430| 6d 70 52 67 6e 29 3b 09 | 09 09 09 09 09 09 09 2f |mpRgn);.|......./|
|00004440| 2a 20 70 75 74 20 62 61 | 63 6b 20 61 6e 79 20 70 |* put ba|ck any p|
|00004450| 72 69 6f 72 20 75 70 64 | 61 74 65 20 2a 2f 0d 09 |rior upd|ate */..|
|00004460| 09 44 69 73 70 6f 73 65 | 52 67 6e 28 74 65 6d 70 |.Dispose|Rgn(temp|
|00004470| 52 67 6e 29 3b 0d 09 7d | 0d 7d 20 2f 2a 20 44 6f |Rgn);..}|.} /* Do|
|00004480| 47 72 6f 77 57 69 6e 64 | 6f 77 20 2a 2f 0d 0d 0d |GrowWind|ow */...|
|00004490| 2f 2a 20 09 43 61 6c 6c | 65 64 20 77 68 65 6e 20 |/* .Call|ed when |
|000044a0| 61 20 6d 6f 75 73 65 43 | 6c 69 63 6b 20 6f 63 63 |a mouseC|lick occ|
|000044b0| 75 72 73 20 69 6e 20 74 | 68 65 20 7a 6f 6f 6d 20 |urs in t|he zoom |
|000044c0| 62 6f 78 20 6f 66 20 61 | 6e 20 61 63 74 69 76 65 |box of a|n active|
|000044d0| 20 77 69 6e 64 6f 77 2e | 0d 09 45 76 65 72 79 74 | window.|..Everyt|
|000044e0| 68 69 6e 67 20 68 61 73 | 20 74 6f 20 67 65 74 20 |hing has| to get |
|000044f0| 72 65 2d 64 72 61 77 6e | 20 68 65 72 65 2c 20 73 |re-drawn| here, s|
|00004500| 6f 20 77 65 20 64 6f 6e | 27 74 20 6d 69 6e 64 20 |o we don|'t mind |
|00004510| 74 68 61 74 0d 09 52 65 | 73 69 7a 65 57 69 6e 64 |that..Re|sizeWind|
|00004520| 6f 77 20 69 6e 76 61 6c | 69 64 61 74 65 73 20 74 |ow inval|idates t|
|00004530| 68 65 20 77 68 6f 6c 65 | 20 70 6f 72 74 52 65 63 |he whole| portRec|
|00004540| 74 2e 20 2a 2f 0d 0d 23 | 64 65 66 69 6e 65 20 5f |t. */..#|define _|
|00004550| 5f 53 45 47 5f 5f 20 4d | 61 69 6e 0d 76 6f 69 64 |_SEG__ M|ain.void|
|00004560| 20 44 6f 5a 6f 6f 6d 57 | 69 6e 64 6f 77 28 77 69 | DoZoomW|indow(wi|
|00004570| 6e 64 6f 77 2c 70 61 72 | 74 29 0d 09 57 69 6e 64 |ndow,par|t)..Wind|
|00004580| 6f 77 50 74 72 09 77 69 | 6e 64 6f 77 3b 0d 09 73 |owPtr.wi|ndow;..s|
|00004590| 68 6f 72 74 09 09 70 61 | 72 74 3b 0d 7b 0d 09 45 |hort..pa|rt;.{..E|
|000045a0| 72 61 73 65 52 65 63 74 | 28 26 77 69 6e 64 6f 77 |raseRect|(&window|
|000045b0| 2d 3e 70 6f 72 74 52 65 | 63 74 29 3b 0d 09 5a 6f |->portRe|ct);..Zo|
|000045c0| 6f 6d 57 69 6e 64 6f 77 | 28 77 69 6e 64 6f 77 2c |omWindow|(window,|
|000045d0| 20 70 61 72 74 2c 20 77 | 69 6e 64 6f 77 20 3d 3d | part, w|indow ==|
|000045e0| 20 46 72 6f 6e 74 57 69 | 6e 64 6f 77 28 29 29 3b | FrontWi|ndow());|
|000045f0| 0d 09 52 65 73 69 7a 65 | 57 69 6e 64 6f 77 28 77 |..Resize|Window(w|
|00004600| 69 6e 64 6f 77 29 3b 0d | 7d 20 2f 2a 20 20 44 6f |indow);.|} /* Do|
|00004610| 5a 6f 6f 6d 57 69 6e 64 | 6f 77 20 2a 2f 0d 0d 0d |ZoomWind|ow */...|
|00004620| 2f 2a 20 43 61 6c 6c 65 | 64 20 77 68 65 6e 20 74 |/* Calle|d when t|
|00004630| 68 65 20 77 69 6e 64 6f | 77 20 68 61 73 20 62 65 |he windo|w has be|
|00004640| 65 6e 20 72 65 73 69 7a | 65 64 20 74 6f 20 66 69 |en resiz|ed to fi|
|00004650| 78 20 75 70 20 74 68 65 | 20 63 6f 6e 74 72 6f 6c |x up the| control|
|00004660| 73 20 61 6e 64 20 63 6f | 6e 74 65 6e 74 2e 20 2a |s and co|ntent. *|
|00004670| 2f 0d 23 64 65 66 69 6e | 65 20 5f 5f 53 45 47 5f |/.#defin|e __SEG_|
|00004680| 5f 20 4d 61 69 6e 0d 76 | 6f 69 64 20 52 65 73 69 |_ Main.v|oid Resi|
|00004690| 7a 65 57 69 6e 64 6f 77 | 28 77 69 6e 64 6f 77 29 |zeWindow|(window)|
|000046a0| 0d 09 57 69 6e 64 6f 77 | 50 74 72 09 77 69 6e 64 |..Window|Ptr.wind|
|000046b0| 6f 77 3b 0d 7b 0d 09 41 | 64 6a 75 73 74 53 63 72 |ow;.{..A|djustScr|
|000046c0| 6f 6c 6c 62 61 72 73 28 | 77 69 6e 64 6f 77 2c 20 |ollbars(|window, |
|000046d0| 74 72 75 65 29 3b 0d 09 | 41 64 6a 75 73 74 54 45 |true);..|AdjustTE|
|000046e0| 28 77 69 6e 64 6f 77 29 | 3b 0d 09 49 6e 76 61 6c |(window)|;..Inval|
|000046f0| 52 65 63 74 28 26 77 69 | 6e 64 6f 77 2d 3e 70 6f |Rect(&wi|ndow->po|
|00004700| 72 74 52 65 63 74 29 3b | 0d 7d 20 2f 2a 20 52 65 |rtRect);|.} /* Re|
|00004710| 73 69 7a 65 57 69 6e 64 | 6f 77 20 2a 2f 0d 0d 0d |sizeWind|ow */...|
|00004720| 2f 2a 20 52 65 74 75 72 | 6e 73 20 74 68 65 20 75 |/* Retur|ns the u|
|00004730| 70 64 61 74 65 20 72 65 | 67 69 6f 6e 20 69 6e 20 |pdate re|gion in |
|00004740| 6c 6f 63 61 6c 20 63 6f | 6f 72 64 69 6e 61 74 65 |local co|ordinate|
|00004750| 73 20 2a 2f 0d 23 64 65 | 66 69 6e 65 20 5f 5f 53 |s */.#de|fine __S|
|00004760| 45 47 5f 5f 20 4d 61 69 | 6e 0d 76 6f 69 64 20 47 |EG__ Mai|n.void G|
|00004770| 65 74 4c 6f 63 61 6c 55 | 70 64 61 74 65 52 67 6e |etLocalU|pdateRgn|
|00004780| 28 77 69 6e 64 6f 77 2c | 6c 6f 63 61 6c 52 67 6e |(window,|localRgn|
|00004790| 29 0d 09 57 69 6e 64 6f | 77 50 74 72 09 77 69 6e |)..Windo|wPtr.win|
|000047a0| 64 6f 77 3b 0d 09 52 67 | 6e 48 61 6e 64 6c 65 09 |dow;..Rg|nHandle.|
|000047b0| 6c 6f 63 61 6c 52 67 6e | 3b 0d 7b 0d 09 43 6f 70 |localRgn|;.{..Cop|
|000047c0| 79 52 67 6e 28 28 28 57 | 69 6e 64 6f 77 50 65 65 |yRgn(((W|indowPee|
|000047d0| 6b 29 20 77 69 6e 64 6f | 77 29 2d 3e 75 70 64 61 |k) windo|w)->upda|
|000047e0| 74 65 52 67 6e 2c 20 6c | 6f 63 61 6c 52 67 6e 29 |teRgn, l|ocalRgn)|
|000047f0| 3b 09 2f 2a 20 73 61 76 | 65 20 6f 6c 64 20 75 70 |;./* sav|e old up|
|00004800| 64 61 74 65 20 72 65 67 | 69 6f 6e 20 2a 2f 0d 09 |date reg|ion */..|
|00004810| 4f 66 66 73 65 74 52 67 | 6e 28 6c 6f 63 61 6c 52 |OffsetRg|n(localR|
|00004820| 67 6e 2c 20 77 69 6e 64 | 6f 77 2d 3e 70 6f 72 74 |gn, wind|ow->port|
|00004830| 42 69 74 73 2e 62 6f 75 | 6e 64 73 2e 6c 65 66 74 |Bits.bou|nds.left|
|00004840| 2c 20 77 69 6e 64 6f 77 | 2d 3e 70 6f 72 74 42 69 |, window|->portBi|
|00004850| 74 73 2e 62 6f 75 6e 64 | 73 2e 74 6f 70 29 3b 0d |ts.bound|s.top);.|
|00004860| 7d 20 2f 2a 20 47 65 74 | 4c 6f 63 61 6c 55 70 64 |} /* Get|LocalUpd|
|00004870| 61 74 65 52 67 6e 20 2a | 2f 0d 0d 0d 2f 2a 09 54 |ateRgn *|/.../*.T|
|00004880| 68 69 73 20 69 73 20 63 | 61 6c 6c 65 64 20 77 68 |his is c|alled wh|
|00004890| 65 6e 20 61 6e 20 75 70 | 64 61 74 65 20 65 76 65 |en an up|date eve|
|000048a0| 6e 74 20 69 73 20 72 65 | 63 65 69 76 65 64 20 66 |nt is re|ceived f|
|000048b0| 6f 72 20 61 20 77 69 6e | 64 6f 77 2e 0d 09 49 74 |or a win|dow...It|
|000048c0| 20 63 61 6c 6c 73 20 44 | 72 61 77 57 69 6e 64 6f | calls D|rawWindo|
|000048d0| 77 20 74 6f 20 64 72 61 | 77 20 74 68 65 20 63 6f |w to dra|w the co|
|000048e0| 6e 74 65 6e 74 73 20 6f | 66 20 61 6e 20 61 70 70 |ntents o|f an app|
|000048f0| 6c 69 63 61 74 69 6f 6e | 20 77 69 6e 64 6f 77 2e |lication| window.|
|00004900| 0d 09 41 73 20 61 6e 20 | 65 66 66 69 63 69 65 6e |..As an |efficien|
|00004910| 63 79 20 6d 65 61 73 75 | 72 65 20 74 68 61 74 20 |cy measu|re that |
|00004920| 64 6f 65 73 20 6e 6f 74 | 20 68 61 76 65 20 74 6f |does not| have to|
|00004930| 20 62 65 20 66 6f 6c 6c | 6f 77 65 64 2c 20 69 74 | be foll|owed, it|
|00004940| 0d 09 63 61 6c 6c 73 20 | 74 68 65 20 64 72 61 77 |..calls |the draw|
|00004950| 69 6e 67 20 72 6f 75 74 | 69 6e 65 20 6f 6e 6c 79 |ing rout|ine only|
|00004960| 20 69 66 20 74 68 65 20 | 76 69 73 52 67 6e 20 69 | if the |visRgn i|
|00004970| 73 20 6e 6f 6e 2d 65 6d | 70 74 79 2e 20 54 68 69 |s non-em|pty. Thi|
|00004980| 73 0d 09 77 69 6c 6c 20 | 68 61 6e 64 6c 65 20 73 |s..will |handle s|
|00004990| 69 74 75 61 74 69 6f 6e | 73 20 77 68 65 72 65 20 |ituation|s where |
|000049a0| 63 61 6c 63 75 6c 61 74 | 69 6f 6e 73 20 66 6f 72 |calculat|ions for|
|000049b0| 20 64 72 61 77 69 6e 67 | 20 6f 72 20 64 72 61 77 | drawing| or draw|
|000049c0| 69 6e 67 0d 09 69 74 73 | 65 6c 66 20 69 73 20 76 |ing..its|elf is v|
|000049d0| 65 72 79 20 74 69 6d 65 | 2d 63 6f 6e 73 75 6d 69 |ery time|-consumi|
|000049e0| 6e 67 2e 20 2a 2f 0d 0d | 23 64 65 66 69 6e 65 20 |ng. */..|#define |
|000049f0| 5f 5f 53 45 47 5f 5f 20 | 4d 61 69 6e 0d 76 6f 69 |__SEG__ |Main.voi|
|00004a00| 64 20 44 6f 55 70 64 61 | 74 65 28 77 69 6e 64 6f |d DoUpda|te(windo|
|00004a10| 77 29 0d 09 57 69 6e 64 | 6f 77 50 74 72 09 77 69 |w)..Wind|owPtr.wi|
|00004a20| 6e 64 6f 77 3b 0d 7b 0d | 09 69 66 20 28 20 49 73 |ndow;.{.|.if ( Is|
|00004a30| 41 70 70 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |AppWindo|w(window|
|00004a40| 29 20 29 20 7b 0d 09 09 | 42 65 67 69 6e 55 70 64 |) ) {...|BeginUpd|
|00004a50| 61 74 65 28 77 69 6e 64 | 6f 77 29 3b 09 09 09 09 |ate(wind|ow);....|
|00004a60| 2f 2a 20 74 68 69 73 20 | 73 65 74 73 20 75 70 20 |/* this |sets up |
|00004a70| 74 68 65 20 76 69 73 52 | 67 6e 20 2a 2f 0d 09 09 |the visR|gn */...|
|00004a80| 69 66 20 28 20 21 20 45 | 6d 70 74 79 52 67 6e 28 |if ( ! E|mptyRgn(|
|00004a90| 77 69 6e 64 6f 77 2d 3e | 76 69 73 52 67 6e 29 20 |window->|visRgn) |
|00004aa0| 29 09 2f 2a 20 64 72 61 | 77 20 69 66 20 75 70 64 |)./* dra|w if upd|
|00004ab0| 61 74 69 6e 67 20 6e 65 | 65 64 73 20 74 6f 20 62 |ating ne|eds to b|
|00004ac0| 65 20 64 6f 6e 65 20 2a | 2f 0d 09 09 09 44 72 61 |e done *|/....Dra|
|00004ad0| 77 57 69 6e 64 6f 77 28 | 77 69 6e 64 6f 77 29 3b |wWindow(|window);|
|00004ae0| 0d 09 09 45 6e 64 55 70 | 64 61 74 65 28 77 69 6e |...EndUp|date(win|
|00004af0| 64 6f 77 29 3b 0d 09 7d | 0d 7d 20 2f 2a 44 6f 55 |dow);..}|.} /*DoU|
|00004b00| 70 64 61 74 65 2a 2f 0d | 0d 0d 2f 2a 09 54 68 69 |pdate*/.|../*.Thi|
|00004b10| 73 20 69 73 20 63 61 6c | 6c 65 64 20 77 68 65 6e |s is cal|led when|
|00004b20| 20 61 20 77 69 6e 64 6f | 77 20 69 73 20 61 63 74 | a windo|w is act|
|00004b30| 69 76 61 74 65 64 20 6f | 72 20 64 65 61 63 74 69 |ivated o|r deacti|
|00004b40| 76 61 74 65 64 2e 0d 09 | 49 74 20 63 61 6c 6c 73 |vated...|It calls|
|00004b50| 20 54 65 78 74 45 64 69 | 74 20 74 6f 20 64 65 61 | TextEdi|t to dea|
|00004b60| 6c 20 77 69 74 68 20 74 | 68 65 20 73 65 6c 65 63 |l with t|he selec|
|00004b70| 74 69 6f 6e 2e 20 2a 2f | 0d 0d 23 64 65 66 69 6e |tion. */|..#defin|
|00004b80| 65 20 5f 5f 53 45 47 5f | 5f 20 4d 61 69 6e 0d 76 |e __SEG_|_ Main.v|
|00004b90| 6f 69 64 20 44 6f 41 63 | 74 69 76 61 74 65 28 77 |oid DoAc|tivate(w|
|00004ba0| 69 6e 64 6f 77 2c 20 62 | 65 63 6f 6d 69 6e 67 41 |indow, b|ecomingA|
|00004bb0| 63 74 69 76 65 29 0d 09 | 57 69 6e 64 6f 77 50 74 |ctive)..|WindowPt|
|00004bc0| 72 09 77 69 6e 64 6f 77 | 3b 0d 09 42 6f 6f 6c 65 |r.window|;..Boole|
|00004bd0| 61 6e 09 09 62 65 63 6f | 6d 69 6e 67 41 63 74 69 |an..beco|mingActi|
|00004be0| 76 65 3b 0d 7b 0d 09 52 | 67 6e 48 61 6e 64 6c 65 |ve;.{..R|gnHandle|
|00004bf0| 09 74 65 6d 70 52 67 6e | 3b 0d 09 52 67 6e 48 61 |.tempRgn|;..RgnHa|
|00004c00| 6e 64 6c 65 09 63 6c 69 | 70 52 67 6e 3b 0d 09 44 |ndle.cli|pRgn;..D|
|00004c10| 6f 63 75 6d 65 6e 74 50 | 65 65 6b 20 64 6f 63 3b |ocumentP|eek doc;|
|00004c20| 0d 09 0d 09 69 66 20 28 | 20 49 73 41 70 70 57 69 |....if (| IsAppWi|
|00004c30| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 20 29 20 7b |ndow(win|dow) ) {|
|00004c40| 0d 09 09 64 6f 63 20 3d | 20 28 44 6f 63 75 6d 65 |...doc =| (Docume|
|00004c50| 6e 74 50 65 65 6b 29 20 | 77 69 6e 64 6f 77 3b 0d |ntPeek) |window;.|
|00004c60| 09 09 69 66 20 28 20 62 | 65 63 6f 6d 69 6e 67 41 |..if ( b|ecomingA|
|00004c70| 63 74 69 76 65 20 29 20 | 7b 0d 09 09 09 2f 2a 09 |ctive ) |{..../*.|
|00004c80| 73 69 6e 63 65 20 77 65 | 20 64 6f 6e d5 74 20 77 |since we| don.t w|
|00004c90| 61 6e 74 20 54 45 41 63 | 74 69 76 61 74 65 20 74 |ant TEAc|tivate t|
|00004ca0| 6f 20 64 72 61 77 20 61 | 20 73 65 6c 65 63 74 69 |o draw a| selecti|
|00004cb0| 6f 6e 20 69 6e 20 61 6e | 20 61 72 65 61 20 77 68 |on in an| area wh|
|00004cc0| 65 72 65 0d 09 09 09 09 | 77 65 d5 72 65 20 67 6f |ere.....|we.re go|
|00004cd0| 69 6e 67 20 74 6f 20 65 | 72 61 73 65 20 61 6e 64 |ing to e|rase and|
|00004ce0| 20 72 65 64 72 61 77 2c | 20 77 65 d5 6c 6c 20 63 | redraw,| we.ll c|
|00004cf0| 6c 69 70 20 6f 75 74 20 | 74 68 65 20 75 70 64 61 |lip out |the upda|
|00004d00| 74 65 20 72 65 67 69 6f | 6e 0d 09 09 09 09 62 65 |te regio|n.....be|
|00004d10| 66 6f 72 65 20 63 61 6c | 6c 69 6e 67 20 69 74 2e |fore cal|ling it.|
|00004d20| 20 2a 2f 0d 09 09 09 74 | 65 6d 70 52 67 6e 20 3d | */....t|empRgn =|
|00004d30| 20 4e 65 77 52 67 6e 28 | 29 3b 0d 09 09 09 63 6c | NewRgn(|);....cl|
|00004d40| 69 70 52 67 6e 20 3d 20 | 4e 65 77 52 67 6e 28 29 |ipRgn = |NewRgn()|
|00004d50| 3b 0d 09 09 09 47 65 74 | 4c 6f 63 61 6c 55 70 64 |;....Get|LocalUpd|
|00004d60| 61 74 65 52 67 6e 28 77 | 69 6e 64 6f 77 2c 20 74 |ateRgn(w|indow, t|
|00004d70| 65 6d 70 52 67 6e 29 3b | 09 09 09 2f 2a 20 67 65 |empRgn);|.../* ge|
|00004d80| 74 20 6c 6f 63 61 6c 69 | 7a 65 64 20 75 70 64 61 |t locali|zed upda|
|00004d90| 74 65 20 72 65 67 69 6f | 6e 20 2a 2f 0d 09 09 09 |te regio|n */....|
|00004da0| 47 65 74 43 6c 69 70 28 | 63 6c 69 70 52 67 6e 29 |GetClip(|clipRgn)|
|00004db0| 3b 0d 09 09 09 44 69 66 | 66 52 67 6e 28 63 6c 69 |;....Dif|fRgn(cli|
|00004dc0| 70 52 67 6e 2c 20 74 65 | 6d 70 52 67 6e 2c 20 74 |pRgn, te|mpRgn, t|
|00004dd0| 65 6d 70 52 67 6e 29 3b | 09 09 09 2f 2a 20 73 75 |empRgn);|.../* su|
|00004de0| 62 74 72 61 63 74 20 75 | 70 64 61 74 65 52 67 6e |btract u|pdateRgn|
|00004df0| 20 66 72 6f 6d 20 63 6c | 69 70 52 67 6e 20 2a 2f | from cl|ipRgn */|
|00004e00| 0d 09 09 09 53 65 74 43 | 6c 69 70 28 74 65 6d 70 |....SetC|lip(temp|
|00004e10| 52 67 6e 29 3b 0d 09 09 | 09 54 45 41 63 74 69 76 |Rgn);...|.TEActiv|
|00004e20| 61 74 65 28 64 6f 63 2d | 3e 64 6f 63 54 45 29 3b |ate(doc-|>docTE);|
|00004e30| 0d 09 09 09 53 65 74 43 | 6c 69 70 28 63 6c 69 70 |....SetC|lip(clip|
|00004e40| 52 67 6e 29 3b 09 09 09 | 09 09 09 09 2f 2a 20 72 |Rgn);...|..../* r|
|00004e50| 65 73 74 6f 72 65 20 74 | 68 65 20 66 75 6c 6c 2d |estore t|he full-|
|00004e60| 62 6c 6f 77 6e 20 63 6c | 69 70 52 67 6e 20 2a 2f |blown cl|ipRgn */|
|00004e70| 0d 09 09 09 44 69 73 70 | 6f 73 65 52 67 6e 28 74 |....Disp|oseRgn(t|
|00004e80| 65 6d 70 52 67 6e 29 3b | 0d 09 09 09 44 69 73 70 |empRgn);|....Disp|
|00004e90| 6f 73 65 52 67 6e 28 63 | 6c 69 70 52 67 6e 29 3b |oseRgn(c|lipRgn);|
|00004ea0| 0d 09 09 09 0d 09 09 09 | 2f 2a 20 74 68 65 20 63 |........|/* the c|
|00004eb0| 6f 6e 74 72 6f 6c 73 20 | 6d 75 73 74 20 62 65 20 |ontrols |must be |
|00004ec0| 72 65 64 72 61 77 6e 20 | 6f 6e 20 61 63 74 69 76 |redrawn |on activ|
|00004ed0| 61 74 69 6f 6e 3a 20 2a | 2f 0d 09 09 09 28 2a 64 |ation: *|/....(*d|
|00004ee0| 6f 63 2d 3e 64 6f 63 56 | 53 63 72 6f 6c 6c 29 2d |oc->docV|Scroll)-|
|00004ef0| 3e 63 6f 6e 74 72 6c 56 | 69 73 20 3d 20 63 6f 6e |>contrlV|is = con|
|00004f00| 74 72 6f 6c 56 69 73 69 | 62 6c 65 3b 0d 09 09 09 |trolVisi|ble;....|
|00004f10| 28 2a 64 6f 63 2d 3e 64 | 6f 63 48 53 63 72 6f 6c |(*doc->d|ocHScrol|
|00004f20| 6c 29 2d 3e 63 6f 6e 74 | 72 6c 56 69 73 20 3d 20 |l)->cont|rlVis = |
|00004f30| 63 6f 6e 74 72 6f 6c 56 | 69 73 69 62 6c 65 3b 0d |controlV|isible;.|
|00004f40| 09 09 09 49 6e 76 61 6c | 52 65 63 74 28 26 28 2a |...Inval|Rect(&(*|
|00004f50| 64 6f 63 2d 3e 64 6f 63 | 56 53 63 72 6f 6c 6c 29 |doc->doc|VScroll)|
|00004f60| 2d 3e 63 6f 6e 74 72 6c | 52 65 63 74 29 3b 0d 09 |->contrl|Rect);..|
|00004f70| 09 09 49 6e 76 61 6c 52 | 65 63 74 28 26 28 2a 64 |..InvalR|ect(&(*d|
|00004f80| 6f 63 2d 3e 64 6f 63 48 | 53 63 72 6f 6c 6c 29 2d |oc->docH|Scroll)-|
|00004f90| 3e 63 6f 6e 74 72 6c 52 | 65 63 74 29 3b 0d 09 09 |>contrlR|ect);...|
|00004fa0| 7d 0d 09 09 65 6c 73 65 | 20 7b 09 09 0d 09 09 09 |}...else| {......|
|00004fb0| 54 45 44 65 61 63 74 69 | 76 61 74 65 28 64 6f 63 |TEDeacti|vate(doc|
|00004fc0| 2d 3e 64 6f 63 54 45 29 | 3b 0d 09 09 09 2f 2a 20 |->docTE)|;..../* |
|00004fd0| 74 68 65 20 63 6f 6e 74 | 72 6f 6c 73 20 6d 75 73 |the cont|rols mus|
|00004fe0| 74 20 62 65 20 68 69 64 | 64 65 6e 20 6f 6e 20 64 |t be hid|den on d|
|00004ff0| 65 61 63 74 69 76 61 74 | 69 6f 6e 3a 20 2a 2f 0d |eactivat|ion: */.|
|00005000| 09 09 09 48 69 64 65 43 | 6f 6e 74 72 6f 6c 28 64 |...HideC|ontrol(d|
|00005010| 6f 63 2d 3e 64 6f 63 56 | 53 63 72 6f 6c 6c 29 3b |oc->docV|Scroll);|
|00005020| 0d 09 09 09 48 69 64 65 | 43 6f 6e 74 72 6f 6c 28 |....Hide|Control(|
|00005030| 64 6f 63 2d 3e 64 6f 63 | 48 53 63 72 6f 6c 6c 29 |doc->doc|HScroll)|
|00005040| 3b 0d 09 09 7d 0d 09 7d | 0d 7d 20 2f 2a 44 6f 41 |;...}..}|.} /*DoA|
|00005050| 63 74 69 76 61 74 65 2a | 2f 0d 0d 0d 2f 2a 09 54 |ctivate*|/.../*.T|
|00005060| 68 69 73 20 69 73 20 63 | 61 6c 6c 65 64 20 77 68 |his is c|alled wh|
|00005070| 65 6e 20 61 20 6d 6f 75 | 73 65 44 6f 77 6e 20 6f |en a mou|seDown o|
|00005080| 63 63 75 72 73 20 69 6e | 20 74 68 65 20 63 6f 6e |ccurs in| the con|
|00005090| 74 65 6e 74 20 6f 66 20 | 61 20 77 69 6e 64 6f 77 |tent of |a window|
|000050a0| 2e 20 2a 2f 0d 0d 23 64 | 65 66 69 6e 65 20 5f 5f |. */..#d|efine __|
|000050b0| 53 45 47 5f 5f 20 4d 61 | 69 6e 0d 76 6f 69 64 20 |SEG__ Ma|in.void |
|000050c0| 44 6f 43 6f 6e 74 65 6e | 74 43 6c 69 63 6b 28 77 |DoConten|tClick(w|
|000050d0| 69 6e 64 6f 77 2c 65 76 | 65 6e 74 29 0d 09 57 69 |indow,ev|ent)..Wi|
|000050e0| 6e 64 6f 77 50 74 72 09 | 77 69 6e 64 6f 77 3b 0d |ndowPtr.|window;.|
|000050f0| 09 45 76 65 6e 74 52 65 | 63 6f 72 64 09 2a 65 76 |.EventRe|cord.*ev|
|00005100| 65 6e 74 3b 0d 7b 0d 09 | 50 6f 69 6e 74 09 09 6d |ent;.{..|Point..m|
|00005110| 6f 75 73 65 3b 0d 09 43 | 6f 6e 74 72 6f 6c 48 61 |ouse;..C|ontrolHa|
|00005120| 6e 64 6c 65 20 63 6f 6e | 74 72 6f 6c 3b 0d 09 73 |ndle con|trol;..s|
|00005130| 68 6f 72 74 09 09 70 61 | 72 74 2c 20 76 61 6c 75 |hort..pa|rt, valu|
|00005140| 65 3b 0d 09 42 6f 6f 6c | 65 61 6e 09 09 73 68 69 |e;..Bool|ean..shi|
|00005150| 66 74 44 6f 77 6e 3b 0d | 09 44 6f 63 75 6d 65 6e |ftDown;.|.Documen|
|00005160| 74 50 65 65 6b 20 64 6f | 63 3b 0d 0d 09 69 66 20 |tPeek do|c;...if |
|00005170| 28 20 49 73 41 70 70 57 | 69 6e 64 6f 77 28 77 69 |( IsAppW|indow(wi|
|00005180| 6e 64 6f 77 29 20 29 20 | 7b 0d 09 09 53 65 74 50 |ndow) ) |{...SetP|
|00005190| 6f 72 74 28 77 69 6e 64 | 6f 77 29 3b 0d 09 09 6d |ort(wind|ow);...m|
|000051a0| 6f 75 73 65 20 3d 20 65 | 76 65 6e 74 2d 3e 77 68 |ouse = e|vent->wh|
|000051b0| 65 72 65 3b 09 09 09 09 | 09 09 09 2f 2a 20 67 65 |ere;....|.../* ge|
|000051c0| 74 20 74 68 65 20 63 6c | 69 63 6b 20 70 6f 73 69 |t the cl|ick posi|
|000051d0| 74 69 6f 6e 20 2a 2f 0d | 09 09 47 6c 6f 62 61 6c |tion */.|..Global|
|000051e0| 54 6f 4c 6f 63 61 6c 28 | 26 6d 6f 75 73 65 29 3b |ToLocal(|&mouse);|
|000051f0| 0d 09 09 70 61 72 74 20 | 3d 20 46 69 6e 64 43 6f |...part |= FindCo|
|00005200| 6e 74 72 6f 6c 28 6d 6f | 75 73 65 2c 20 77 69 6e |ntrol(mo|use, win|
|00005210| 64 6f 77 2c 20 26 63 6f | 6e 74 72 6f 6c 29 3b 0d |dow, &co|ntrol);.|
|00005220| 09 09 64 6f 63 20 3d 20 | 28 44 6f 63 75 6d 65 6e |..doc = |(Documen|
|00005230| 74 50 65 65 6b 29 20 77 | 69 6e 64 6f 77 3b 0d 09 |tPeek) w|indow;..|
|00005240| 09 73 77 69 74 63 68 20 | 28 20 70 61 72 74 20 29 |.switch |( part )|
|00005250| 20 7b 0d 09 09 09 63 61 | 73 65 20 30 3a 09 09 09 | {....ca|se 0:...|
|00005260| 09 09 09 09 2f 2a 20 6e | 6f 74 20 69 6e 20 61 20 |..../* n|ot in a |
|00005270| 63 6f 6e 74 72 6f 6c 2a | 2f 0d 09 09 09 09 2f 2a |control*|/...../*|
|00005280| 20 73 65 65 20 69 66 20 | 77 65 20 6e 65 65 64 20 | see if |we need |
|00005290| 74 6f 20 65 78 74 65 6e | 64 20 74 68 65 20 73 65 |to exten|d the se|
|000052a0| 6c 65 63 74 69 6f 6e 20 | 2a 2f 0d 09 09 09 09 73 |lection |*/.....s|
|000052b0| 68 69 66 74 44 6f 77 6e | 20 3d 20 28 65 76 65 6e |hiftDown| = (even|
|000052c0| 74 2d 3e 6d 6f 64 69 66 | 69 65 72 73 20 26 20 73 |t->modif|iers & s|
|000052d0| 68 69 66 74 4b 65 79 29 | 20 21 3d 20 30 3b 09 2f |hiftKey)| != 0;./|
|000052e0| 2a 20 65 78 74 65 6e 64 | 20 69 66 20 53 68 69 66 |* extend| if Shif|
|000052f0| 74 20 69 73 20 64 6f 77 | 6e 20 2a 2f 0d 09 09 09 |t is dow|n */....|
|00005300| 09 54 45 43 6c 69 63 6b | 28 6d 6f 75 73 65 2c 20 |.TEClick|(mouse, |
|00005310| 73 68 69 66 74 44 6f 77 | 6e 2c 20 64 6f 63 2d 3e |shiftDow|n, doc->|
|00005320| 64 6f 63 54 45 29 3b 0d | 09 09 09 09 62 72 65 61 |docTE);.|....brea|
|00005330| 6b 3b 0d 09 09 09 63 61 | 73 65 20 69 6e 54 68 75 |k;....ca|se inThu|
|00005340| 6d 62 3a 0d 09 09 09 09 | 76 61 6c 75 65 20 3d 20 |mb:.....|value = |
|00005350| 47 65 74 43 74 6c 56 61 | 6c 75 65 28 63 6f 6e 74 |GetCtlVa|lue(cont|
|00005360| 72 6f 6c 29 3b 0d 09 09 | 09 09 70 61 72 74 20 3d |rol);...|..part =|
|00005370| 20 54 72 61 63 6b 43 6f | 6e 74 72 6f 6c 28 63 6f | TrackCo|ntrol(co|
|00005380| 6e 74 72 6f 6c 2c 20 6d | 6f 75 73 65 2c 20 6e 69 |ntrol, m|ouse, ni|
|00005390| 6c 29 3b 0d 09 09 09 09 | 69 66 20 28 20 70 61 72 |l);.....|if ( par|
|000053a0| 74 20 21 3d 20 30 20 29 | 20 7b 0d 09 09 09 09 09 |t != 0 )| {......|
|000053b0| 76 61 6c 75 65 20 2d 3d | 20 47 65 74 43 74 6c 56 |value -=| GetCtlV|
|000053c0| 61 6c 75 65 28 63 6f 6e | 74 72 6f 6c 29 3b 0d 09 |alue(con|trol);..|
|000053d0| 09 09 09 09 2f 2a 20 76 | 61 6c 75 65 20 6e 6f 77 |..../* v|alue now|
|000053e0| 20 68 61 73 20 43 48 41 | 4e 47 45 20 69 6e 20 76 | has CHA|NGE in v|
|000053f0| 61 6c 75 65 3b 20 69 66 | 20 76 61 6c 75 65 20 63 |alue; if| value c|
|00005400| 68 61 6e 67 65 64 2c 20 | 73 63 72 6f 6c 6c 20 2a |hanged, |scroll *|
|00005410| 2f 0d 09 09 09 09 09 69 | 66 20 28 20 76 61 6c 75 |/......i|f ( valu|
|00005420| 65 20 21 3d 20 30 20 29 | 0d 09 09 09 09 09 09 69 |e != 0 )|.......i|
|00005430| 66 20 28 20 63 6f 6e 74 | 72 6f 6c 20 3d 3d 20 64 |f ( cont|rol == d|
|00005440| 6f 63 2d 3e 64 6f 63 56 | 53 63 72 6f 6c 6c 20 29 |oc->docV|Scroll )|
|00005450| 0d 09 09 09 09 09 09 09 | 54 45 53 63 72 6f 6c 6c |........|TEScroll|
|00005460| 28 30 2c 20 76 61 6c 75 | 65 20 2a 20 28 2a 64 6f |(0, valu|e * (*do|
|00005470| 63 2d 3e 64 6f 63 54 45 | 29 2d 3e 6c 69 6e 65 48 |c->docTE|)->lineH|
|00005480| 65 69 67 68 74 2c 20 64 | 6f 63 2d 3e 64 6f 63 54 |eight, d|oc->docT|
|00005490| 45 29 3b 0d 09 09 09 09 | 09 09 65 6c 73 65 0d 09 |E);.....|..else..|
|000054a0| 09 09 09 09 09 09 54 45 | 53 63 72 6f 6c 6c 28 76 |......TE|Scroll(v|
|000054b0| 61 6c 75 65 2c 20 30 2c | 20 64 6f 63 2d 3e 64 6f |alue, 0,| doc->do|
|000054c0| 63 54 45 29 3b 0d 09 09 | 09 09 7d 0d 09 09 09 09 |cTE);...|..}.....|
|000054d0| 62 72 65 61 6b 3b 0d 09 | 09 09 64 65 66 61 75 6c |break;..|..defaul|
|000054e0| 74 3a 09 09 09 09 09 09 | 2f 2a 20 74 68 65 79 20 |t:......|/* they |
|000054f0| 63 6c 69 63 6b 65 64 20 | 69 6e 20 61 6e 20 61 72 |clicked |in an ar|
|00005500| 72 6f 77 2c 20 73 6f 20 | 74 72 61 63 6b 20 26 20 |row, so |track & |
|00005510| 73 63 72 6f 6c 6c 20 2a | 2f 0d 09 09 09 09 69 66 |scroll *|/.....if|
|00005520| 20 28 20 63 6f 6e 74 72 | 6f 6c 20 3d 3d 20 64 6f | ( contr|ol == do|
|00005530| 63 2d 3e 64 6f 63 56 53 | 63 72 6f 6c 6c 20 29 0d |c->docVS|croll ).|
|00005540| 09 09 09 09 09 76 61 6c | 75 65 20 3d 20 54 72 61 |.....val|ue = Tra|
|00005550| 63 6b 43 6f 6e 74 72 6f | 6c 28 63 6f 6e 74 72 6f |ckContro|l(contro|
|00005560| 6c 2c 20 6d 6f 75 73 65 | 2c 20 28 50 72 6f 63 50 |l, mouse|, (ProcP|
|00005570| 74 72 29 20 56 41 63 74 | 69 6f 6e 50 72 6f 63 29 |tr) VAct|ionProc)|
|00005580| 3b 0d 09 09 09 09 65 6c | 73 65 0d 09 09 09 09 09 |;.....el|se......|
|00005590| 76 61 6c 75 65 20 3d 20 | 54 72 61 63 6b 43 6f 6e |value = |TrackCon|
|000055a0| 74 72 6f 6c 28 63 6f 6e | 74 72 6f 6c 2c 20 6d 6f |trol(con|trol, mo|
|000055b0| 75 73 65 2c 20 28 50 72 | 6f 63 50 74 72 29 20 48 |use, (Pr|ocPtr) H|
|000055c0| 41 63 74 69 6f 6e 50 72 | 6f 63 29 3b 0d 09 09 09 |ActionPr|oc);....|
|000055d0| 09 62 72 65 61 6b 3b 0d | 09 09 7d 0d 09 7d 0d 7d |.break;.|..}..}.}|
|000055e0| 20 2f 2a 44 6f 43 6f 6e | 74 65 6e 74 43 6c 69 63 | /*DoCon|tentClic|
|000055f0| 6b 2a 2f 0d 0d 0d 2f 2a | 20 54 68 69 73 20 69 73 |k*/.../*| This is|
|00005600| 20 63 61 6c 6c 65 64 20 | 66 6f 72 20 61 6e 79 20 | called |for any |
|00005610| 6b 65 79 44 6f 77 6e 20 | 6f 72 20 61 75 74 6f 4b |keyDown |or autoK|
|00005620| 65 79 20 65 76 65 6e 74 | 73 2c 20 65 78 63 65 70 |ey event|s, excep|
|00005630| 74 20 77 68 65 6e 20 74 | 68 65 0d 20 43 6f 6d 6d |t when t|he. Comm|
|00005640| 61 6e 64 20 6b 65 79 20 | 69 73 20 68 65 6c 64 20 |and key |is held |
|00005650| 64 6f 77 6e 2e 20 49 74 | 20 6c 6f 6f 6b 73 20 61 |down. It| looks a|
|00005660| 74 20 74 68 65 20 66 72 | 6f 6e 74 6d 6f 73 74 20 |t the fr|ontmost |
|00005670| 77 69 6e 64 6f 77 20 74 | 6f 20 64 65 63 69 64 65 |window t|o decide|
|00005680| 20 77 68 61 74 0d 20 74 | 6f 20 64 6f 20 77 69 74 | what. t|o do wit|
|00005690| 68 20 74 68 65 20 6b 65 | 79 20 74 79 70 65 64 2e |h the ke|y typed.|
|000056a0| 20 2a 2f 0d 0d 23 64 65 | 66 69 6e 65 20 5f 5f 53 | */..#de|fine __S|
|000056b0| 45 47 5f 5f 20 4d 61 69 | 6e 0d 76 6f 69 64 20 44 |EG__ Mai|n.void D|
|000056c0| 6f 4b 65 79 44 6f 77 6e | 28 65 76 65 6e 74 29 0d |oKeyDown|(event).|
|000056d0| 09 45 76 65 6e 74 52 65 | 63 6f 72 64 09 2a 65 76 |.EventRe|cord.*ev|
|000056e0| 65 6e 74 3b 0d 7b 0d 09 | 57 69 6e 64 6f 77 50 74 |ent;.{..|WindowPt|
|000056f0| 72 09 77 69 6e 64 6f 77 | 3b 0d 09 63 68 61 72 09 |r.window|;..char.|
|00005700| 09 6b 65 79 3b 0d 09 54 | 45 48 61 6e 64 6c 65 09 |.key;..T|EHandle.|
|00005710| 74 65 3b 0d 0d 09 77 69 | 6e 64 6f 77 20 3d 20 46 |te;...wi|ndow = F|
|00005720| 72 6f 6e 74 57 69 6e 64 | 6f 77 28 29 3b 0d 09 69 |rontWind|ow();..i|
|00005730| 66 20 28 20 49 73 41 70 | 70 57 69 6e 64 6f 77 28 |f ( IsAp|pWindow(|
|00005740| 77 69 6e 64 6f 77 29 20 | 29 20 7b 0d 09 09 74 65 |window) |) {...te|
|00005750| 20 3d 20 28 28 44 6f 63 | 75 6d 65 6e 74 50 65 65 | = ((Doc|umentPee|
|00005760| 6b 29 20 77 69 6e 64 6f | 77 29 2d 3e 64 6f 63 54 |k) windo|w)->docT|
|00005770| 45 3b 0d 09 09 6b 65 79 | 20 3d 20 65 76 65 6e 74 |E;...key| = event|
|00005780| 2d 3e 6d 65 73 73 61 67 | 65 20 26 20 63 68 61 72 |->messag|e & char|
|00005790| 43 6f 64 65 4d 61 73 6b | 3b 0d 09 09 2f 2a 20 77 |CodeMask|;.../* w|
|000057a0| 65 20 68 61 76 65 20 61 | 20 63 68 61 72 2e 20 66 |e have a| char. f|
|000057b0| 6f 72 20 6f 75 72 20 77 | 69 6e 64 6f 77 3b 20 73 |or our w|indow; s|
|000057c0| 65 65 20 69 66 20 77 65 | 20 61 72 65 20 73 74 69 |ee if we| are sti|
|000057d0| 6c 6c 20 62 65 6c 6f 77 | 20 54 65 78 74 45 64 69 |ll below| TextEdi|
|000057e0| 74 d5 73 0d 09 09 09 6c | 69 6d 69 74 20 66 6f 72 |t.s....l|imit for|
|000057f0| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 63 | the num|ber of c|
|00005800| 68 61 72 61 63 74 65 72 | 73 20 2a 2f 0d 09 09 69 |haracter|s */...i|
|00005810| 66 20 28 20 28 2a 74 65 | 29 2d 3e 74 65 4c 65 6e |f ( (*te|)->teLen|
|00005820| 67 74 68 20 2d 20 28 28 | 2a 74 65 29 2d 3e 73 65 |gth - ((|*te)->se|
|00005830| 6c 45 6e 64 20 2d 20 28 | 2a 74 65 29 2d 3e 73 65 |lEnd - (|*te)->se|
|00005840| 6c 53 74 61 72 74 29 20 | 2b 20 31 20 3c 0d 09 09 |lStart) |+ 1 <...|
|00005850| 09 09 6d 61 78 54 45 4c | 65 6e 67 74 68 20 29 20 |..maxTEL|ength ) |
|00005860| 7b 0d 09 09 09 54 45 4b | 65 79 28 6b 65 79 2c 20 |{....TEK|ey(key, |
|00005870| 74 65 29 3b 0d 09 09 09 | 41 64 6a 75 73 74 53 63 |te);....|AdjustSc|
|00005880| 72 6f 6c 6c 62 61 72 73 | 28 77 69 6e 64 6f 77 2c |rollbars|(window,|
|00005890| 20 66 61 6c 73 65 29 3b | 0d 09 09 09 41 64 6a 75 | false);|....Adju|
|000058a0| 73 74 54 45 28 77 69 6e | 64 6f 77 29 3b 0d 09 09 |stTE(win|dow);...|
|000058b0| 7d 20 65 6c 73 65 0d 09 | 09 09 53 79 73 42 65 65 |} else..|..SysBee|
|000058c0| 70 28 38 29 3b 0d 09 7d | 0d 7d 20 2f 2a 44 6f 4b |p(8);..}|.} /*DoK|
|000058d0| 65 79 44 6f 77 6e 2a 2f | 0d 0d 0d 2f 2a 09 43 61 |eyDown*/|.../*.Ca|
|000058e0| 6c 63 75 6c 61 74 65 20 | 61 20 73 6c 65 65 70 20 |lculate |a sleep |
|000058f0| 76 61 6c 75 65 20 66 6f | 72 20 57 61 69 74 4e 65 |value fo|r WaitNe|
|00005900| 78 74 45 76 65 6e 74 2e | 20 54 68 69 73 20 74 61 |xtEvent.| This ta|
|00005910| 6b 65 73 20 69 6e 74 6f | 20 61 63 63 6f 75 6e 74 |kes into| account|
|00005920| 20 74 68 65 20 74 68 69 | 6e 67 73 0d 09 74 68 61 | the thi|ngs..tha|
|00005930| 74 20 44 6f 49 64 6c 65 | 20 64 6f 65 73 20 77 69 |t DoIdle| does wi|
|00005940| 74 68 20 69 64 6c 65 20 | 74 69 6d 65 2e 20 2a 2f |th idle |time. */|
|00005950| 0d 0d 23 64 65 66 69 6e | 65 20 5f 5f 53 45 47 5f |..#defin|e __SEG_|
|00005960| 5f 20 4d 61 69 6e 0d 75 | 6e 73 69 67 6e 65 64 20 |_ Main.u|nsigned |
|00005970| 6c 6f 6e 67 20 47 65 74 | 53 6c 65 65 70 28 29 0d |long Get|Sleep().|
|00005980| 7b 0d 09 6c 6f 6e 67 09 | 09 73 6c 65 65 70 3b 0d |{..long.|.sleep;.|
|00005990| 09 57 69 6e 64 6f 77 50 | 74 72 09 77 69 6e 64 6f |.WindowP|tr.windo|
|000059a0| 77 3b 0d 09 54 45 48 61 | 6e 64 6c 65 09 74 65 3b |w;..TEHa|ndle.te;|
|000059b0| 0d 0d 09 73 6c 65 65 70 | 20 3d 20 4d 41 58 4c 4f |...sleep| = MAXLO|
|000059c0| 4e 47 3b 09 09 09 09 09 | 09 2f 2a 20 64 65 66 61 |NG;.....|./* defa|
|000059d0| 75 6c 74 20 76 61 6c 75 | 65 20 66 6f 72 20 73 6c |ult valu|e for sl|
|000059e0| 65 65 70 20 2a 2f 0d 09 | 69 66 20 28 20 21 67 49 |eep */..|if ( !gI|
|000059f0| 6e 42 61 63 6b 67 72 6f | 75 6e 64 20 29 20 7b 0d |nBackgro|und ) {.|
|00005a00| 09 09 77 69 6e 64 6f 77 | 20 3d 20 46 72 6f 6e 74 |..window| = Front|
|00005a10| 57 69 6e 64 6f 77 28 29 | 3b 09 09 09 2f 2a 20 61 |Window()|;.../* a|
|00005a20| 6e 64 20 74 68 65 20 66 | 72 6f 6e 74 20 77 69 6e |nd the f|ront win|
|00005a30| 64 6f 77 20 69 73 20 6f | 75 72 73 2e 2e 2e 20 2a |dow is o|urs... *|
|00005a40| 2f 0d 09 09 69 66 20 28 | 20 49 73 41 70 70 57 69 |/...if (| IsAppWi|
|00005a50| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 20 29 20 7b |ndow(win|dow) ) {|
|00005a60| 0d 09 09 09 74 65 20 3d | 20 28 28 44 6f 63 75 6d |....te =| ((Docum|
|00005a70| 65 6e 74 50 65 65 6b 29 | 20 28 77 69 6e 64 6f 77 |entPeek)| (window|
|00005a80| 29 29 2d 3e 64 6f 63 54 | 45 3b 09 2f 2a 20 61 6e |))->docT|E;./* an|
|00005a90| 64 20 74 68 65 20 73 65 | 6c 65 63 74 69 6f 6e 20 |d the se|lection |
|00005aa0| 69 73 20 61 6e 20 69 6e | 73 65 72 74 69 6f 6e 20 |is an in|sertion |
|00005ab0| 70 6f 69 6e 74 2e 2e 2e | 20 2a 2f 0d 09 09 09 69 |point...| */....i|
|00005ac0| 66 20 28 20 28 2a 74 65 | 29 2d 3e 73 65 6c 53 74 |f ( (*te|)->selSt|
|00005ad0| 61 72 74 20 3d 3d 20 28 | 2a 74 65 29 2d 3e 73 65 |art == (|*te)->se|
|00005ae0| 6c 45 6e 64 20 29 0d 09 | 09 09 09 73 6c 65 65 70 |lEnd )..|...sleep|
|00005af0| 20 3d 20 47 65 74 43 61 | 72 65 74 54 69 6d 65 28 | = GetCa|retTime(|
|00005b00| 29 3b 09 09 2f 2a 20 62 | 6c 69 6e 6b 20 74 69 6d |);../* b|link tim|
|00005b10| 65 20 66 6f 72 20 74 68 | 65 20 69 6e 73 65 72 74 |e for th|e insert|
|00005b20| 69 6f 6e 20 70 6f 69 6e | 74 20 2a 2f 0d 09 09 7d |ion poin|t */...}|
|00005b30| 0d 09 7d 0d 09 72 65 74 | 75 72 6e 20 73 6c 65 65 |..}..ret|urn slee|
|00005b40| 70 3b 0d 7d 20 2f 2a 47 | 65 74 53 6c 65 65 70 2a |p;.} /*G|etSleep*|
|00005b50| 2f 0d 0d 0d 2f 2a 09 43 | 6f 6d 6d 6f 6e 20 61 6c |/.../*.C|ommon al|
|00005b60| 67 6f 72 69 74 68 6d 20 | 66 6f 72 20 70 69 6e 6e |gorithm |for pinn|
|00005b70| 69 6e 67 20 74 68 65 20 | 76 61 6c 75 65 20 6f 66 |ing the |value of|
|00005b80| 20 61 20 63 6f 6e 74 72 | 6f 6c 2e 20 49 74 20 72 | a contr|ol. It r|
|00005b90| 65 74 75 72 6e 73 20 74 | 68 65 20 61 63 74 75 61 |eturns t|he actua|
|00005ba0| 6c 20 61 6d 6f 75 6e 74 | 0d 09 74 68 65 20 76 61 |l amount|..the va|
|00005bb0| 6c 75 65 20 6f 66 20 74 | 68 65 20 63 6f 6e 74 72 |lue of t|he contr|
|00005bc0| 6f 6c 20 63 68 61 6e 67 | 65 64 2e 20 4e 6f 74 65 |ol chang|ed. Note|
|00005bd0| 20 74 68 65 20 70 69 6e | 6e 69 6e 67 20 69 73 20 | the pin|ning is |
|00005be0| 64 6f 6e 65 20 66 6f 72 | 20 74 68 65 20 73 61 6b |done for| the sak|
|00005bf0| 65 20 6f 66 20 72 65 74 | 75 72 6e 69 6e 67 0d 09 |e of ret|urning..|
|00005c00| 74 68 65 20 61 6d 6f 75 | 6e 74 20 74 68 65 20 63 |the amou|nt the c|
|00005c10| 6f 6e 74 72 6f 6c 20 76 | 61 6c 75 65 20 63 68 61 |ontrol v|alue cha|
|00005c20| 6e 67 65 64 2e 20 2a 2f | 0d 0d 23 64 65 66 69 6e |nged. */|..#defin|
|00005c30| 65 20 5f 5f 53 45 47 5f | 5f 20 4d 61 69 6e 0d 76 |e __SEG_|_ Main.v|
|00005c40| 6f 69 64 20 43 6f 6d 6d | 6f 6e 41 63 74 69 6f 6e |oid Comm|onAction|
|00005c50| 28 63 6f 6e 74 72 6f 6c | 2c 61 6d 6f 75 6e 74 29 |(control|,amount)|
|00005c60| 0d 09 43 6f 6e 74 72 6f | 6c 48 61 6e 64 6c 65 20 |..Contro|lHandle |
|00005c70| 63 6f 6e 74 72 6f 6c 3b | 0d 09 73 68 6f 72 74 09 |control;|..short.|
|00005c80| 09 2a 61 6d 6f 75 6e 74 | 3b 0d 7b 0d 09 73 68 6f |.*amount|;.{..sho|
|00005c90| 72 74 09 09 76 61 6c 75 | 65 2c 20 6d 61 78 3b 0d |rt..valu|e, max;.|
|00005ca0| 09 0d 09 76 61 6c 75 65 | 20 3d 20 47 65 74 43 74 |...value| = GetCt|
|00005cb0| 6c 56 61 6c 75 65 28 63 | 6f 6e 74 72 6f 6c 29 3b |lValue(c|ontrol);|
|00005cc0| 09 2f 2a 20 67 65 74 20 | 63 75 72 72 65 6e 74 20 |./* get |current |
|00005cd0| 76 61 6c 75 65 20 2a 2f | 0d 09 6d 61 78 20 3d 20 |value */|..max = |
|00005ce0| 47 65 74 43 74 6c 4d 61 | 78 28 63 6f 6e 74 72 6f |GetCtlMa|x(contro|
|00005cf0| 6c 29 3b 09 09 2f 2a 20 | 61 6e 64 20 6d 61 78 69 |l);../* |and maxi|
|00005d00| 6d 75 6d 20 76 61 6c 75 | 65 20 2a 2f 0d 09 2a 61 |mum valu|e */..*a|
|00005d10| 6d 6f 75 6e 74 20 3d 20 | 76 61 6c 75 65 20 2d 20 |mount = |value - |
|00005d20| 2a 61 6d 6f 75 6e 74 3b | 0d 09 69 66 20 28 20 2a |*amount;|..if ( *|
|00005d30| 61 6d 6f 75 6e 74 20 3c | 20 30 20 29 0d 09 09 2a |amount <| 0 )...*|
|00005d40| 61 6d 6f 75 6e 74 20 3d | 20 30 3b 0d 09 65 6c 73 |amount =| 0;..els|
|00005d50| 65 20 69 66 20 28 20 2a | 61 6d 6f 75 6e 74 20 3e |e if ( *|amount >|
|00005d60| 20 6d 61 78 20 29 0d 09 | 09 2a 61 6d 6f 75 6e 74 | max )..|.*amount|
|00005d70| 20 3d 20 6d 61 78 3b 0d | 09 53 65 74 43 74 6c 56 | = max;.|.SetCtlV|
|00005d80| 61 6c 75 65 28 63 6f 6e | 74 72 6f 6c 2c 20 2a 61 |alue(con|trol, *a|
|00005d90| 6d 6f 75 6e 74 29 3b 0d | 09 2a 61 6d 6f 75 6e 74 |mount);.|.*amount|
|00005da0| 20 3d 20 76 61 6c 75 65 | 20 2d 20 2a 61 6d 6f 75 | = value| - *amou|
|00005db0| 6e 74 3b 09 09 2f 2a 20 | 63 61 6c 63 75 6c 61 74 |nt;../* |calculat|
|00005dc0| 65 20 74 68 65 20 72 65 | 61 6c 20 63 68 61 6e 67 |e the re|al chang|
|00005dd0| 65 20 2a 2f 0d 7d 20 2f | 2a 20 43 6f 6d 6d 6f 6e |e */.} /|* Common|
|00005de0| 41 63 74 69 6f 6e 20 2a | 2f 0d 0d 0d 2f 2a 20 44 |Action *|/.../* D|
|00005df0| 65 74 65 72 6d 69 6e 65 | 73 20 68 6f 77 20 6d 75 |etermine|s how mu|
|00005e00| 63 68 20 74 6f 20 63 68 | 61 6e 67 65 20 74 68 65 |ch to ch|ange the|
|00005e10| 20 76 61 6c 75 65 20 6f | 66 20 74 68 65 20 76 65 | value o|f the ve|
|00005e20| 72 74 69 63 61 6c 20 73 | 63 72 6f 6c 6c 62 61 72 |rtical s|crollbar|
|00005e30| 20 62 79 20 61 6e 64 20 | 68 6f 77 0d 09 6d 75 63 | by and |how..muc|
|00005e40| 68 20 74 6f 20 73 63 72 | 6f 6c 6c 20 74 68 65 20 |h to scr|oll the |
|00005e50| 54 45 20 72 65 63 6f 72 | 64 2e 20 2a 2f 0d 0d 23 |TE recor|d. */..#|
|00005e60| 64 65 66 69 6e 65 20 5f | 5f 53 45 47 5f 5f 20 4d |define _|_SEG__ M|
|00005e70| 61 69 6e 0d 70 61 73 63 | 61 6c 20 76 6f 69 64 20 |ain.pasc|al void |
|00005e80| 56 41 63 74 69 6f 6e 50 | 72 6f 63 28 63 6f 6e 74 |VActionP|roc(cont|
|00005e90| 72 6f 6c 2c 70 61 72 74 | 29 0d 09 43 6f 6e 74 72 |rol,part|)..Contr|
|00005ea0| 6f 6c 48 61 6e 64 6c 65 | 20 63 6f 6e 74 72 6f 6c |olHandle| control|
|00005eb0| 3b 0d 09 73 68 6f 72 74 | 09 09 70 61 72 74 3b 0d |;..short|..part;.|
|00005ec0| 7b 0d 09 73 68 6f 72 74 | 09 09 61 6d 6f 75 6e 74 |{..short|..amount|
|00005ed0| 3b 0d 09 57 69 6e 64 6f | 77 50 74 72 09 77 69 6e |;..Windo|wPtr.win|
|00005ee0| 64 6f 77 3b 0d 09 54 45 | 50 74 72 09 09 74 65 3b |dow;..TE|Ptr..te;|
|00005ef0| 0d 09 0d 09 69 66 20 28 | 20 70 61 72 74 20 21 3d |....if (| part !=|
|00005f00| 20 30 20 29 20 7b 09 09 | 09 09 2f 2a 20 69 66 20 | 0 ) {..|../* if |
|00005f10| 69 74 20 77 61 73 20 61 | 63 74 75 61 6c 6c 79 20 |it was a|ctually |
|00005f20| 69 6e 20 74 68 65 20 63 | 6f 6e 74 72 6f 6c 20 2a |in the c|ontrol *|
|00005f30| 2f 0d 09 09 77 69 6e 64 | 6f 77 20 3d 20 28 2a 63 |/...wind|ow = (*c|
|00005f40| 6f 6e 74 72 6f 6c 29 2d | 3e 63 6f 6e 74 72 6c 4f |ontrol)-|>contrlO|
|00005f50| 77 6e 65 72 3b 0d 09 09 | 74 65 20 3d 20 2a 28 28 |wner;...|te = *((|
|00005f60| 44 6f 63 75 6d 65 6e 74 | 50 65 65 6b 29 20 77 69 |Document|Peek) wi|
|00005f70| 6e 64 6f 77 29 2d 3e 64 | 6f 63 54 45 3b 0d 09 09 |ndow)->d|ocTE;...|
|00005f80| 73 77 69 74 63 68 20 28 | 20 70 61 72 74 20 29 20 |switch (| part ) |
|00005f90| 7b 0d 09 09 09 63 61 73 | 65 20 69 6e 55 70 42 75 |{....cas|e inUpBu|
|00005fa0| 74 74 6f 6e 3a 0d 09 09 | 09 63 61 73 65 20 69 6e |tton:...|.case in|
|00005fb0| 44 6f 77 6e 42 75 74 74 | 6f 6e 3a 09 09 2f 2a 20 |DownButt|on:../* |
|00005fc0| 6f 6e 65 20 6c 69 6e 65 | 20 2a 2f 0d 09 09 09 09 |one line| */.....|
|00005fd0| 61 6d 6f 75 6e 74 20 3d | 20 31 3b 0d 09 09 09 09 |amount =| 1;.....|
|00005fe0| 62 72 65 61 6b 3b 0d 09 | 09 09 63 61 73 65 20 69 |break;..|..case i|
|00005ff0| 6e 50 61 67 65 55 70 3a | 09 09 09 2f 2a 20 6f 6e |nPageUp:|.../* on|
|00006000| 65 20 70 61 67 65 20 2a | 2f 0d 09 09 09 63 61 73 |e page *|/....cas|
|00006010| 65 20 69 6e 50 61 67 65 | 44 6f 77 6e 3a 0d 09 09 |e inPage|Down:...|
|00006020| 09 09 61 6d 6f 75 6e 74 | 20 3d 20 28 74 65 2d 3e |..amount| = (te->|
|00006030| 76 69 65 77 52 65 63 74 | 2e 62 6f 74 74 6f 6d 20 |viewRect|.bottom |
|00006040| 2d 20 74 65 2d 3e 76 69 | 65 77 52 65 63 74 2e 74 |- te->vi|ewRect.t|
|00006050| 6f 70 29 20 2f 20 74 65 | 2d 3e 6c 69 6e 65 48 65 |op) / te|->lineHe|
|00006060| 69 67 68 74 3b 0d 09 09 | 09 09 62 72 65 61 6b 3b |ight;...|..break;|
|00006070| 0d 09 09 7d 0d 09 09 69 | 66 20 28 20 28 70 61 72 |...}...i|f ( (par|
|00006080| 74 20 3d 3d 20 69 6e 44 | 6f 77 6e 42 75 74 74 6f |t == inD|ownButto|
|00006090| 6e 29 20 7c 7c 20 28 70 | 61 72 74 20 3d 3d 20 69 |n) || (p|art == i|
|000060a0| 6e 50 61 67 65 44 6f 77 | 6e 29 20 29 0d 09 09 09 |nPageDow|n) )....|
|000060b0| 61 6d 6f 75 6e 74 20 3d | 20 2d 61 6d 6f 75 6e 74 |amount =| -amount|
|000060c0| 3b 09 09 2f 2a 20 72 65 | 76 65 72 73 65 20 64 69 |;../* re|verse di|
|000060d0| 72 65 63 74 69 6f 6e 20 | 66 6f 72 20 61 20 64 6f |rection |for a do|
|000060e0| 77 6e 65 72 20 2a 2f 0d | 09 09 43 6f 6d 6d 6f 6e |wner */.|..Common|
|000060f0| 41 63 74 69 6f 6e 28 63 | 6f 6e 74 72 6f 6c 2c 20 |Action(c|ontrol, |
|00006100| 26 61 6d 6f 75 6e 74 29 | 3b 0d 09 09 69 66 20 28 |&amount)|;...if (|
|00006110| 20 61 6d 6f 75 6e 74 20 | 21 3d 20 30 20 29 0d 09 | amount |!= 0 )..|
|00006120| 09 09 54 45 53 63 72 6f | 6c 6c 28 30 2c 20 61 6d |..TEScro|ll(0, am|
|00006130| 6f 75 6e 74 20 2a 20 74 | 65 2d 3e 6c 69 6e 65 48 |ount * t|e->lineH|
|00006140| 65 69 67 68 74 2c 20 28 | 28 44 6f 63 75 6d 65 6e |eight, (|(Documen|
|00006150| 74 50 65 65 6b 29 20 77 | 69 6e 64 6f 77 29 2d 3e |tPeek) w|indow)->|
|00006160| 64 6f 63 54 45 29 3b 0d | 09 7d 0d 7d 20 2f 2a 20 |docTE);.|.}.} /* |
|00006170| 56 41 63 74 69 6f 6e 50 | 72 6f 63 20 2a 2f 0d 0d |VActionP|roc */..|
|00006180| 0d 2f 2a 20 44 65 74 65 | 72 6d 69 6e 65 73 20 68 |./* Dete|rmines h|
|00006190| 6f 77 20 6d 75 63 68 20 | 74 6f 20 63 68 61 6e 67 |ow much |to chang|
|000061a0| 65 20 74 68 65 20 76 61 | 6c 75 65 20 6f 66 20 74 |e the va|lue of t|
|000061b0| 68 65 20 68 6f 72 69 7a | 6f 6e 74 61 6c 20 73 63 |he horiz|ontal sc|
|000061c0| 72 6f 6c 6c 62 61 72 20 | 62 79 20 61 6e 64 20 68 |rollbar |by and h|
|000061d0| 6f 77 0d 6d 75 63 68 20 | 74 6f 20 73 63 72 6f 6c |ow.much |to scrol|
|000061e0| 6c 20 74 68 65 20 54 45 | 20 72 65 63 6f 72 64 2e |l the TE| record.|
|000061f0| 20 2a 2f 0d 0d 23 64 65 | 66 69 6e 65 20 5f 5f 53 | */..#de|fine __S|
|00006200| 45 47 5f 5f 20 4d 61 69 | 6e 0d 70 61 73 63 61 6c |EG__ Mai|n.pascal|
|00006210| 20 76 6f 69 64 20 48 41 | 63 74 69 6f 6e 50 72 6f | void HA|ctionPro|
|00006220| 63 28 63 6f 6e 74 72 6f | 6c 2c 70 61 72 74 29 0d |c(contro|l,part).|
|00006230| 09 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 20 63 |.Control|Handle c|
|00006240| 6f 6e 74 72 6f 6c 3b 0d | 09 73 68 6f 72 74 09 09 |ontrol;.|.short..|
|00006250| 70 61 72 74 3b 0d 7b 0d | 09 73 68 6f 72 74 09 09 |part;.{.|.short..|
|00006260| 61 6d 6f 75 6e 74 3b 0d | 09 57 69 6e 64 6f 77 50 |amount;.|.WindowP|
|00006270| 74 72 09 77 69 6e 64 6f | 77 3b 0d 09 54 45 50 74 |tr.windo|w;..TEPt|
|00006280| 72 09 09 74 65 3b 0d 09 | 0d 09 69 66 20 28 20 70 |r..te;..|..if ( p|
|00006290| 61 72 74 20 21 3d 20 30 | 20 29 20 7b 0d 09 09 77 |art != 0| ) {...w|
|000062a0| 69 6e 64 6f 77 20 3d 20 | 28 2a 63 6f 6e 74 72 6f |indow = |(*contro|
|000062b0| 6c 29 2d 3e 63 6f 6e 74 | 72 6c 4f 77 6e 65 72 3b |l)->cont|rlOwner;|
|000062c0| 0d 09 09 74 65 20 3d 20 | 2a 28 28 44 6f 63 75 6d |...te = |*((Docum|
|000062d0| 65 6e 74 50 65 65 6b 29 | 20 77 69 6e 64 6f 77 29 |entPeek)| window)|
|000062e0| 2d 3e 64 6f 63 54 45 3b | 0d 09 09 73 77 69 74 63 |->docTE;|...switc|
|000062f0| 68 20 28 20 70 61 72 74 | 20 29 20 7b 0d 09 09 09 |h ( part| ) {....|
|00006300| 63 61 73 65 20 69 6e 55 | 70 42 75 74 74 6f 6e 3a |case inU|pButton:|
|00006310| 0d 09 09 09 63 61 73 65 | 20 69 6e 44 6f 77 6e 42 |....case| inDownB|
|00006320| 75 74 74 6f 6e 3a 09 09 | 2f 2a 20 61 20 66 65 77 |utton:..|/* a few|
|00006330| 20 70 69 78 65 6c 73 20 | 2a 2f 0d 09 09 09 09 61 | pixels |*/.....a|
|00006340| 6d 6f 75 6e 74 20 3d 20 | 62 75 74 74 6f 6e 53 63 |mount = |buttonSc|
|00006350| 72 6f 6c 6c 3b 0d 09 09 | 09 09 62 72 65 61 6b 3b |roll;...|..break;|
|00006360| 0d 09 09 09 63 61 73 65 | 20 69 6e 50 61 67 65 55 |....case| inPageU|
|00006370| 70 3a 09 09 09 2f 2a 20 | 61 20 70 61 67 65 20 2a |p:.../* |a page *|
|00006380| 2f 0d 09 09 09 63 61 73 | 65 20 69 6e 50 61 67 65 |/....cas|e inPage|
|00006390| 44 6f 77 6e 3a 0d 09 09 | 09 09 61 6d 6f 75 6e 74 |Down:...|..amount|
|000063a0| 20 3d 20 74 65 2d 3e 76 | 69 65 77 52 65 63 74 2e | = te->v|iewRect.|
|000063b0| 72 69 67 68 74 20 2d 20 | 74 65 2d 3e 76 69 65 77 |right - |te->view|
|000063c0| 52 65 63 74 2e 6c 65 66 | 74 3b 0d 09 09 09 09 62 |Rect.lef|t;.....b|
|000063d0| 72 65 61 6b 3b 0d 09 09 | 7d 0d 09 09 69 66 20 28 |reak;...|}...if (|
|000063e0| 20 28 70 61 72 74 20 3d | 3d 20 69 6e 44 6f 77 6e | (part =|= inDown|
|000063f0| 42 75 74 74 6f 6e 29 20 | 7c 7c 20 28 70 61 72 74 |Button) ||| (part|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.